2. Basic Programming Concepts

Total Page:16

File Type:pdf, Size:1020Kb

2. Basic Programming Concepts COMPUTER SCIENCE COMPUTER SCIENCE SEDGEWICK/WAYNE SEDGEWICK/WAYNE 2. Basic Programming Concepts •Why programming? 2. Basic Programming •Program development Concepts •Built-in data types •Type conversion Sections 1.1 and 1.2 http://introcs.cs.princeton.edu CS.2.A.Basics.Why You need to know how to program Programming: telling a computer what to do in order to be able to tell a computer what you want it to do. Programming Naive ideal: Natural language instructions. • Is not just for experts. • Is a natural, satisfying and creative experience. “Please simulate the motion of N heavenly bodies, subject to Newton’s laws of motion and gravity.” • Enables accomplishments not otherwise possible. • The path to a new world of intellectual endeavor. Prepackaged solutions (apps) are great when what they do is what you want. Challenges • Need to learn what computers can do. • Need to learn a programming language. Telling a computer what to do Programming enables you to make a computer do anything you want. well, almost anything (stay tuned) “ Instead of imagining that our main task is to instruct a first programmer first computer computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. ” − Don Knuth Analytical Ada Lovelace Engine 3 4 Telling a computer what to do Our Choice: Java Machine language Natural language High-level language Java features • Easy for computer. • Easy for human. • Some difficulty for both. • Widely used. • Error-prone for human. • Error-prone for computer. • An acceptable tradeoff. • Widely available. • Continuously under development since early 1990s. Kids Make Nutritious Snacks. for (int t = 0; t < 2000; t++) • Embraces full set of modern abstractions. 10: 8A00 RA ← mem[00] { 11: 8B01 RB ← mem[01] a[0] = (a[11] ^ a[9]); • Variety of automatic checks for mistakes in programs. 12: 1CAB RC ← RA + RB Red Tape Holds Up New Bridge. System.out.print(a[0]); James Gosling 13: 9C02 mem[02] ← RC Police Squad Helps Dog Bite Victim. for (int i = 11; i > 0; i--) 14: 0000 halt a[i] = a[i-1]; } $100 billion, Adding two numbers (see Lecture 10) Local High School Dropouts Cut in Half. Java economy 5 million developers Actual newspaper headlines Simulating an LFSR (see Lecture 1) • Mars rover. —Rich Pattis • Cell phones. But which high-level language? • Blu-ray Disc. • Web servers. • Medical devices. • Supercomputing. • … Naive ideal: A single programming language for all purposes. 5 6 Our Choice: Java A rich subset of the Java language vocabulary Java features built-in operations on String object Math numeric types types operations assignment oriented methods Math • Widely used. methods int + + = static Math.sin() punctuation • Widely available. long - "" class Math.cos() Math.sin()int • Continuously under development since early 1990s. double * length() flow control public Math.log() Math.cos()long System Math.log() • Embraces full set of modern abstractions. char / charAt() if private Math.exp() methods double Math.exp() • Variety of automatic checks for mistakes in programs. String % compareTo() else new Math.pow() System.print() char Math.pow() boolean ++ matches() for final Math.sqrt() System.println() String Math.sqrt() Facts of life “ There are only two kinds of -- while toString() Math.min() System.printf() boolean programming languages: those boolean main() Math.max() Math.min() • No language is perfect. punctuation comparisons operations people always [gripe] about and our Std methods Math.max() • You need to start with some language. { < true arrays Math.abs() StdIn.read*() those nobody uses.” Math.PI Math.abs() } <= false a[] StdOut.print*() Math.PI − Bjarne Stroustrup ( > Our approach ! length type conversion methods StdDraw.*() ) >= && new • Use a minimal subset of Java. Integer.parseInt() StdAudio.*() , == || • Develop general programming skills that are applicable to many languages. Double.parseDouble() StdRandom.*() ; != It’s not about the language! Your programs will primarily consist of these plus identifiers (names) that you make up. 7 8 Anatomy of your first program Anatomy of your next several programs program name program name main() method main() method text file named text file named HelloWorld.java public class HelloWorld MyProgram.java public class MyProgram { { public static void main(String[] args) public static void main(String[] args) { { System.out.println("Hello, World"); ... } } } } body of main() (a single statement) body of main() (a sequence of statements) 9 10 Pop quiz on "your first program" (easy if you did Exercise 1.1.2) Three versions of the same program. Q. Use common sense to cope with the following error messages. public class HelloWorld { public static void main(String[] args) { % javac MyProgram.java System.out.println("Hello, World"); } % java MyProgram } Main method not public. /************************************************************************* * Compilation: javac HelloWorld.java * Execution: java HelloWorld * * Prints "Hello, World". By tradition, this is everyone's first program. * * % java HelloWorld * Hello, World * *************************************************************************/ public class HelloWorld { % javac MyProgram.java public static void main(String[] args) { MyProgram.java:3: invalid method declaration; return type required System.out.println("Hello, World"); } public static main(String[] args) } ^ public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); } } Lesson: Fonts, color, comments, and extra space are not relevant to Java. 11 12 Note on program style COMPUTER SCIENCE SEDGEWICK/WAYNE Different styles are appropriate in different contexts. • DrJava • Booksite • Book • Your code Enforcing consistent style can 2. Basic Programming Concepts • Stifle creativity. • Confuse style with language. •Why programming? •Program development Emphasizing consistent style can • Make it easier to spot errors. •Built-in data types • Make it easier for others to read and use code. •Type conversion • Enable development environment to provide visual cues. Bottom line for this course: Life is easiest if you use DrJava style. 13 CS.2.B.Basics.Develop Program development in Java Software for program development is a three-step process, with feedback Any creative process involves cyclic refinement/development. 1. EDIT your program EDIT COMPOSE • Create it by typing on your computer's keyboard. • Result: a text file such as HelloWorld.java. COMPILE RUN REHEARSE PLAY EDIT 2. COMPILE it to create an executable file • Use the Java compiler A significant difference with programs: We can use our computers to faciliate the process. • Result: a Java bytecode file file such as HelloWorld.class Program development environment: Software for editing, compiling and running programs. • Mistake? Go back to 1. to fix and recompile. COMPILE RUN not a legal Java program 3. RUN your program Two time-tested options: (Stay tuned for details). • Use the Java runtime. • Result: your program’s output. Virtual terminals Integrated development environment • Mistake? Go back to 1. to fix, recompile, and execute • Same for many languages and systems. • Often language- or system-specific. a legal Java program that does the wrong thing • Effective even for beginners. • Can be helpful to beginners. Bottom line: Extremely simple and concise. Bottom line: Variety of useful tools. 15 16 Program development environments: a very short history Program development with switches and lights Historical context is important in computer science. Circa 1970: Use switches to input binary program code and data, lights to read output. • We regularly use old software. • We regularly emulate old hardware. • We depend upon old concepts and designs. PDP-8, circa 1970 lights Widely-used methods for program development • switches and lights 1960 • punched cards/compiler/runtime 1970 • editor/compiler/runtime/terminal • editor/compiler/runtime/virtual terminal 1980 • integrated development environment 1990 switches 2000 Stay tuned for details [lectures on the "TOY machine"]. 17 18 Program development with punched cards and line printers Program development with timesharing terminals Mid 1970s: Use punched cards to input program code and data, line printer for output. Late 1970s: Use terminal for editing program, reading output, and controlling computer. IBM System 360, circa 1975 VAX 11/780 circa 1977 VT-100 terminal Ask your parents about the "computer center" for details. Timesharing allowed many users to share the same computer. 19 20 Program development with personal computers (one approach) Program development with personal computers (another approach) 1980s to present day: Use multiple virtual terminals to interact with computer. 1980s to present day: Use a customized application for program development tasks. • Edit your program using any text editor in a virtual terminal. • Edit your program using the built-in text editor. • Compile it by typing javac HelloWorld.java in another virtual terminal. • Compile it by clicking the “compile” button. • Run it by typing javac HelloWorld.java • Run it by clicking the “run” button or using the pseudo-command line. “Integrated Development Environment” (IDE) virtual terminal for editor virtual terminal to compile, run and examine output http://drjava.org “compile” button invoke Java compiler at command line “run” button invoke Java runtime at command line pseudo-command line virtual TV set 21 22 Software for program development: tradeoffs Lessons from short history Virtual terminals
Recommended publications
  • Customizing and Extending Powerdesigner SAP Powerdesigner Documentation Collection Content
    User Guide PUBLIC SAP PowerDesigner Document Version: 16.6.2 – 2017-01-05 Customizing and Extending PowerDesigner SAP PowerDesigner Documentation Collection Content 1 PowerDesigner Resource Files.................................................... 9 1.1 Opening Resource Files in the Editor.................................................10 1.2 Navigating and Searching in Resource Files............................................ 11 1.3 Editing Resource Files........................................................... 13 1.4 Saving Changes................................................................13 1.5 Sharing and Embedding Resource Files...............................................13 1.6 Creating and Copying Resource Files.................................................14 1.7 Specifying Directories to Search for Resource Files.......................................15 1.8 Comparing Resource Files........................................................ 15 1.9 Merging Resource Files.......................................................... 16 2 Extension Files................................................................18 2.1 Creating an Extension File.........................................................19 2.2 Attaching Extensions to a Model....................................................20 2.3 Exporting an Embedded Extension File for Sharing.......................................21 2.4 Extension File Properties......................................................... 21 2.5 Example: Adding a New Attribute from a Property
    [Show full text]
  • PL/SQL Data Types
    PPLL//SSQQLL -- DDAATTAA TTYYPPEESS http://www.tutorialspoint.com/plsql/plsql_data_types.htm Copyright © tutorialspoint.com PL/SQL variables, constants and parameters must have a valid data type, which specifies a storage format, constraints, and valid range of values. This tutorial will take you through SCALAR and LOB data types available in PL/SQL and other two data types will be covered in other chapters. Category Description Scalar Single values with no internal components, such as a NUMBER, DATE, or BOOLEAN. Large Object LOB Pointers to large objects that are stored separately from other data items, such as text, graphic images, video clips, and sound waveforms. Composite Data items that have internal components that can be accessed individually. For example, collections and records. Reference Pointers to other data items. PL/SQL Scalar Data Types and Subtypes PL/SQL Scalar Data Types and Subtypes come under the following categories: Date Type Description Numeric Numeric values on which arithmetic operations are performed. Character Alphanumeric values that represent single characters or strings of characters. Boolean Logical values on which logical operations are performed. Datetime Dates and times. PL/SQL provides subtypes of data types. For example, the data type NUMBER has a subtype called INTEGER. You can use subtypes in your PL/SQL program to make the data types compatible with data types in other programs while embedding PL/SQL code in another program, such as a Java program. PL/SQL Numeric Data Types and Subtypes Following
    [Show full text]
  • Boolean Data Type & Expressions Outline Basic Data Types
    Boolean Data Type & Expressions Outline Basic Data Types 1. Boolean Data Type & Expressions Outline Numeric 2. Basic Data Types – int 3. C Boolean Data Types: char or int/ – float Boolean Declaration Non-numeric 4. Boolean or Character? – char 5. Boolean Literal Constants #include <stdio.h> 6. Boolean Expressions/ int main () Boolean Operations ¡ /* main */ 7. Example: Boolean Literal Constants & Expressions float standard_deviation, relative_humidity; int count, number_of_silly_people; 8. Example: Boolean Variables char middle_initial, hometown[30]; ¢ 9. Relational Operations /* main */ 10. Example: Relational Expressions 11. Structure of Boolean Expressions 12. Precedence Order of Boolean Operations 13. Another Boolean Precedence Example 14. Example: Boolean Precedence Order 15. Example: More Relational Expressions 16. Example: More Relational Expressions (continued) 17. Short Circuiting 18. Exercise: Writing a Program 1 2 C Boolean Data Type: char or int Boolean or Character? The C data type typically used for storing Boolean values is char, Question: How does the C compiler know that a particular char although int will also work. declaration is a Boolean rather than a character? Like numeric data types, Booleans have particular ways of being Answer: It doesn’t. stored in memory and of being operated on. % cat shortcircuit.c #include <stdio.h> Conceptually, a Boolean value represents a single bit in memory, char int int main () although the and data types aren’t implemented this ¡ /* main */ way — if for no other reason than that computers can’t address a const int maximum_short_height_in_cm = 170; single bit, since the smallest collection of bits that they can address int my_height_in_cm = 160; char I_am_Henry = 1; is a byte (or, in a few cases, a word).
    [Show full text]
  • Xml Schema Boolean Data Type Example
    Xml Schema Boolean Data Type Example Binomial and uncomposable Hussein often inveighs some masterdom alongside or apologizes flawlessly. Sandro is unwitting and congeed worst as ninety Lovell minimises greenly and candling avertedly. Postponed or palsy-walsy, Nahum never sectionalises any height-to-paper! Our solution can be used by sql anywhere enables complex xml data For example Integerlength2 allows 10 99 and 1 but not 100 9 or 10. Implemented across major programming languages and a school setting mode switches for a csv go by first search pattern on the button clicks, including different parts: xml schema boolean data type. Package API xmlschema 142 documentation. Int xmlhttpexamplecom sequence Virtual bool xmlhttpexamplecom virtual. Creating a fact data item in XNAT consists of creating the XSD that defines the data center itself. Wrapping character type. XSD Miscellaneous Data Types Tutorialspoint. XML Schema Instance namespace available. Field Constraints and Validation Nuxeo Documentation. Examples of the schema describing the binary data Overview. OpenClinica supports a subset of many Item Data Types defined in ODM. Use the same type to data type of text. AS CSV GO I consider XML as the best solution in terms of code and performance. Thank you guys so much! Datatype Examples Collection area HL7Wiki. Dependent child elements with xsdassert Oxygen XML Forum. With join syntax limit syntaxx views inserts boolean handling of NULLS. XML Schema Simple Elements. The correct performance: although it else you can be extremely important in schema in property with a namespace declaration will validate xml? Set to b are not validated during the value as the values, and removed the xml schema to be masked in xml schema? All data dictionary and examples and hard to use.
    [Show full text]
  • Declare True in C
    Declare True In C When Trent maladminister his prunes unpins not crazily enough, is Rog draperied? Marlowe is irreducibly repayable after attenuated Miles congregate his mumblers adorably. Emilio often sorrow municipally when relaxant Ximenez mispunctuating scenically and overstrikes her idiotism. Learn more concise, in true then you have just same To lateral the size of your trade in bytes you then use the sizeof operator int a17 sizet n sizeofa On my computer ints are 4 bytes long so n is 6 To determine what number of elements in input array we shall divide those total size of flash array apply the size of one array element. A true boolean data type gonna be used for storing logical values and would only submit two legal values true memory false C does cab have boolean data types and normally uses integers for boolean testing Zero is used to fire false just One is used to fill true. In C any nonzero value is treated as true health a zero value is treated as. Groovy also supports the Java colon variation with colons for char c text. A hollow object declared in this way will have no values other share the. A variable declaration always contains two components the responsible of the variable. 49 Boolean values Learn C. Documentation Advanced Types TypeScript. Operators in C CodesDope. Boolean bool or Bool datatype in C C programming language from C99 supports Boolean data type bool and internally it was referred as Bool as boolean was update a datatype in early versions of C. Bool type C reference Microsoft Docs.
    [Show full text]
  • 4 Data Types
    4 Data Types VHDL is a strongly typed language. Every constant, signal, variable, function, and parameter is declared with a type, such as BOOLEAN or INTEGER, and can hold or return only a value of that type. VHDL predefines abstract data types, such as BOOLEAN, which are part of most programming languages, and hardware-re- lated types, such as BIT, found in most hardware languages. VHDL predefined types are declared in the STANDARD pack- age, which is supplied with all VHDL implementations (see Example 4–14). Data types addresses information about Enumeration Types Enumeration Overloading Enumeration Encoding Integer Types Array Types Record Types Predefined VHDL Data Types HOME CONTENTS INDEX For further assistance, email [email protected] or call your local support center V3.4 VHDL Compiler Reference Unsupported Data Types Synopsys Data Types Subtypes The advantage of strong typing is that VHDL tools can catch many common design errors, such as assigning an eight-bit value to a four-bit-wide signal, or incrementing an array index out of its range. The following code shows the definition of a new type, BYTE, as an array of eight bits, and a variable declaration, ADDEND, that uses this type. type BYTE is array(7 downto 0) of BIT; variable ADDEND: BYTE; The predefined VHDL data types are built from the basic VHDL data types. Some VHDL types are not supported for synthesis, such as REAL and FILE. The examples in this chapter show type definitions and associated object declarations. Although each constant, signal, variable, function, and parameter is declared with a type, only variable and signal declarations are shown here in the examples.
    [Show full text]
  • Fundamental Programming Concepts
    APPENDIX A Fundamental Programming Concepts The following information is for readers who are new to programming and need a primer on some fundamental programming concepts. If you have programmed in another language, chances are the concepts presented in this appendix are not new to you. You should, however, review the material briefly to become familiar with the C# syntax. Working with Variables and Data Types Variables in programming languages store values that can change while the program executes. For example, if you wanted to count the number of times a user tries to log in to an application, you could use a variable to track the number of attempts. A variable is a memory location where a value is stored. Using the variable, your program can read or alter the value stored in memory. Before you use a variable in your program, however, you must declare it. When you declare a variable, the compiler also needs to know what kind of data will be stored at the memory location. For example, will it be numbers or letters? If the variable will store numbers, how large can a number be? Will the variable store decimals or only whole numbers? You answer these questions by assigning a data type to the variable. A login counter, for example, only needs to hold positive whole numbers. The following code demonstrates how you declare a variable named counter in C# with an integer data type: int counter; Specifying the data type is referred to as strong typing. Strong typing results in more efficient memory management, faster execution, and compiler type checking, all of which reduces runtime errors.
    [Show full text]
  • How to Use Basic Boolean Functions Tutorial
    How to Use Basic Boolean Functions Tutorial Functions -> Programming -> Boolean -> And , Or , Not , Not Or (NOR) , Not And (NAND) , Exclusive Or (XOR) , Not Exclusive Or (XNOR) , True , False This tutorial will explain how to use the Boolean data type and Boolean functions such as those used in Boolean algebra like AND, OR, and NOT (conjunction, disjunction, and negation respectively). These functions are similar to the basic logic gates used to design circuits and only perform two bit input operations. Boolean data types have only two values, “True” and “False”. Booleans are have their own set of functions that deal exclusively with manipulating Booleans that are derived directly from Boolean algebra and are the primary means of manipulating Boolean data types. These functions are also known as logical operators or logic gates which are discussed below. Because of the simplicity of the Boolean data type, they are frequently used as the values used to drive conditional branching and decision making structures. To find the logical operator gates, start by opening the Functions palette and selecting the Programming palette. Then select the Boolean palette . This should bring up the Boolean operator functions. Select the function that you want to use and place it in your block diagram. Each function except the NOT, True, and False functions takes two Booleans as its inputs and, because of the rules of Boolean logic, the order of the inputs does not matter. In addition, each function outputs a Boolean value depending on whether the logical operator evaluates the two inputs as True or False. The NOT function serves as a negation function that takes a Boolean value and outputs the opposite Boolean value (i.e.
    [Show full text]
  • Functional, Actor Based Programming Language
    Oscar Functional, Actor based Programming Language Manager: Ethan Adams EA2678 ​ Language Guru: Howon Byun HB2458 ​ System Architect: Jibben Lee Grabscheid Hillen JLH2218 ​ System Architect: Vladislav Sergeevich Scherbich VSS2113 ​ Tester: Anthony James Holley AJH2186 ​ Table of Contents Introduction Core Concepts Immutability Actor Lexical Conventions Identifiers Keywords Punctuation Operators Types Programming Structure Introduction We will be implementing an Actor-Oriented Language. We all know there are difficulties associated with parallel computation, namely data collision when multiple threads access the same data. Most often, this requires explicitly defining locks and mutexes to control data access to resolve this issue, which adds significant mental and code overhead. The Actor model is a different approach to this problem that relies on the concept of message-passing between processes. The model simplifies the aforementioned difficulties of multiprocessing by abstracting explicit method calls, and relying on each “actor” to handle tasks and encapsulate mutable data. We would like to construct our language based off Erlang and Akka framework. Core Concepts Immutability Values in Oscar are immutable like Haskell and Ocaml. This means that when a non-atomic value is declared, it cannot be reassigned and function parameters are passed by value. For instance, this is not allowed. int x = 5; x = 4; // error For primitive container types like list, map and set, they have an additional property ​ ​ ​ ​ that re-assigning values returns a new copy of the data structure with those updates applied. list<int> initList == [1, 2, 3, 4, 5]; list<int> changedList = (initList[3] = -4); changedList == [1, 2, 3, -4, 5]; initList == [1, 2, 3, 4, 5]; Passing objects by value seems like a massive performance drain.
    [Show full text]
  • Data Types in C
    Princeton University Computer Science 217: Introduction to Programming Systems Data Types in C 1 Goals of C Designers wanted C to: But also: Support system programming Support application programming Be low-level Be portable Be easy for people to handle Be easy for computers to handle • Conflicting goals on multiple dimensions! • Result: different design decisions than Java 2 Primitive Data Types • integer data types • floating-point data types • pointer data types • no character data type (use small integer types instead) • no character string data type (use arrays of small ints instead) • no logical or boolean data types (use integers instead) For “under the hood” details, stay tuned for “number systems” lecture next week 3 Integer Data Types Integer types of various sizes: signed char, short, int, long • char is 1 byte • Number of bits per byte is unspecified! (but in the 21st century, pretty safe to assume it’s 8) • Sizes of other integer types not fully specified but constrained: • int was intended to be “natural word size” • 2 ≤ sizeof(short) ≤ sizeof(int) ≤ sizeof(long) On ArmLab: • Natural word size: 8 bytes (“64-bit machine”) • char: 1 byte • short: 2 bytes • int: 4 bytes (compatibility with widespread 32-bit code) 8 bytes • long: What decisions did the designers of Java make? 4 Integer Literals • Decimal: 123 • Octal: 0173 = 123 • Hexadecimal: 0x7B = 123 • Use "L" suffix to indicate long literal • No suffix to indicate short literal; instead must use cast Examples • int: 123, 0173, 0x7B • long: 123L, 0173L, 0x7BL • short: (short)123,
    [Show full text]
  • Declaring Boolean in C
    Declaring Boolean In C Occult and acetabular Marilu vivifies her appeasers orchestrate while Thibaut trichinising some lardons imminently. Which Giffer underworking so nights that Gunther moseying her epilator? Depletable Fredrick always scarfs his cerussite if Waverly is ailurophobic or normalises theocratically. When the collection of a boolean in the most other values or the statements to have you come on pointer operators can write them unless listed above The array in c numeric and. The mechanics of errors as an ascii equivalents, and semantics of a variable which is not prepared to give a method. Use a name conflicts in a new list has ended if one by that can be necessary questions which say the end of improving performance. Give the other boost library functions may also be declared as well in a derived classes from this. Format a developer needs to all naming of vertical whitespace. The size of the printf format unnamed namespaces automatically between the second matrix size and videos that? Are boolean values for booleans and, who are evaluated first section later call the following table we have little information about anything about objects which keeps track. As possible in boolean variable i tried it possible by declaring boolean in c preprocessor will notify you can be consistent with all. So in boolean situations where the field. Proper capitalization and understand the open braces, then to not intended to the next chapter that act on a short document? In this is a double, all improve readability of this case people or oral, without this keyword is forbidden within the reader that make an else.
    [Show full text]
  • On the Standardization of Fundamental Bit Manipulation Utilities
    Document number: P0237R0 Date: 2016–02–12 Project: ISO JTC1/SC22/WG21: Programming Language C++ Audience: Library Evolution Working Group, SG14 Reply to: Vincent Reverdy ([email protected]) On the standardization of fundamental bit manipulation utilities Vincent Reverdy1 and Robert J. Brunner1 1Department of Astronomy, University of Illinois at Urbana-Champaign, 1002 W. Green St., Urbana, IL 61801 Abstract We discuss the addition to the standard library of class templates to ease the manipulation of bits in C++. This includes a bit_value class emulating a single bit, a bit_reference em- ulating a reference to a bit, a bit_pointer emulating a pointer to a bit, and a bit_iterator to iterate on bits. These tools would provide a solid foundation of algorithms operating on bits and would facilitate the use of unsigned integers as bit containers. Contents 1 Introduction2 2 Motivation2 3 Impact on the standard3 4 Design decisions4 5 Technical specications 16 6 Alternative technical specications 26 7 Discussion and open questions 29 8 Acknowledgements 30 9 References 31 1 1 Introduction This proposal introduces a class template std::bit_reference that is designed to emulate a ref- erence to a bit. It is inspired by the existing nested classes of the standard library: std::bitset:: reference and std::vector<bool>::reference, but this new class is made available to C++ developers as a basic tool to construct their own bit containers and algorithms. It is supple- mented by a std::bit_value class to deal with non-referenced and temporary bit values. To provide a complete and consistent set of tools, we also introduce a std::bit_pointer in order to emulate the behaviour of a pointer to a bit.
    [Show full text]