跳到內容

constructs

本頁內容尚未翻譯。

data FloatNotation

How a floating value is written: %g, %f or %e (std::defaultfloat, std::fixed, std::scientific).

record StreamFormat

An output stream’s format ([ios.base]): the base of integers, whether to show it, upper case, bool as words, a plus sign, the width of the next output and its fill, left alignment, how floating values are written and their precision (negative is none: 6, as printf’s).

def StreamFormat.initial : StreamFormat

The format a stream starts with: decimal, no width, spaces, right aligned, %g with precision 6.

record StreamState

The streams’ state: std::cout’s format, and the base std::cin reads integers in.

def StreamState.initial : StreamState

The streams at the start.

data OutputKind

What an output writes: an integer of a type (a character type’s is the character), a floating value, the string a char pointer points to, or text as written (std::endl’s newline).

data FormatChange

A change of a stream’s format: a manipulator, or std::setw, std::setprecision, std::setfill with the operand.

data InputKind

What std::cin reads into: a number (an integer of the target’s type, a character type’s one character, a floating value), a word into a character array, a word or a line into a std::string (its data, size and capacity), or nothing (std::cin.ignore(count, delimiter): characters dropped).

data StreamStatement

A statement of the streams: an output to std::cout of the operand, a change of its format, an input from std::cin into the operands, a change of the base std::cin reads integers in.

data ObjectStatement

A statement of objects made by new: allocating one (or an array, zero-filled or not) and putting its pointer in a variable, releasing one (or an array) delete was given; making a declaration a guard of a constructed member; destroying the elements of an array new[] made (by their class’s destructor, the last first); releasing a block the library allocated, or keeping it under a new number, because of an implementation’s choice (the choice’s name); making a static object of a function the first time its declaration is reached (its statements, unless its global scope has it already) and moving it into the global scope.

record CatchLabel

A handler of a try block: the type name it catches (none for catch (...)) and the label of its code in the try’s block.

record Catchable

A name an exception can be caught by: a type’s name and the path (the members’ positions) to the subobject a handler of that type refers to (empty for the exception’s own type, a base class subobject’s for a base).

data ExceptionStatement

A statement of exceptions: throwing the value (with the names it can be caught by and the one it is reported by), throwing an object constructed in a declaration (handed to the exception, the declaration’s scope does not end it), throwing again the one being handled, running a try block’s body with its handlers, adopting the exception being handled into the handler’s scope (it ends with it), finishing a handler, and running a noexcept function’s body.

data EnvironmentStatement

A statement of the program’s environment (the primitives the Arduino library is written with): advancing the simulated time by its operand, in microseconds; showing the host a value or a text for kind:index (the operands are the index and the value, or a pointer to the text); the declaration of the object a pointer points into, for kind:index; a pin’s change (the pin and the value); a precondition of the environment’s library, named, that the first operand is not zero (the second is the detail the stop reports: the pin, for one); the run reaching where what happens next cannot be told (the hardware’s behavior, named); an index past a container’s elements (the operands are the index and the number of elements: the run stops, out of bounds).

data CppStatement

C++‘s statements: the streams’, the objects’, the exceptions’ and the environment’s.

data CppFrame

C++’s frames: a try block’s body running, its handlers by label in the block; where an exception passing ends the run (a noexcept function’s body, [except.spec]p5, and where a partial unwinding stops).

data CppAllocation

How C++ allocates a block: by new, by new[] (each must be released by the matching delete, [expr.delete]p2), for an exception object; or a guard of a member a constructor has constructed (a pointer to it: when an exception leaves the constructor, the member is destroyed, [except.ctor]p3).

record ClassMember

A class member by name, its access, and whether it is explicit (a conversion function, [class.conv.fct]p2).

record StaticMember

A static member of a class ([class.static]): what it is lowered to (the global’s declaration, or the function C::f), its name in the class, and its access.

record Constructor

A constructor: the function it is lowered to, how many parameters it takes, how many of them have no default (the fewest arguments it is called with), its access, whether it is explicit (not used for implicit conversions, [class.conv.ctor]p1), whether it is implicit (one the class does not declare: the default constructor a class needs, the copy or move constructor that copies its members), and whether it is a constructor template (its function the function template C::C#ck, an instance of which a construction deduces, [temp.mem]p1).

record ClassBase

A direct base class: its name, how it is inherited (public, protected or private), and whether it is a virtual base (one subobject shared by every path to it, [class.mi]p6).

record ClassMembers

A class: its name, direct bases in order, members (data members and member functions), constructors (none for an aggregate, which is initialized by its members), whether it has a destructor to run, its copy constructor (declared or implicit), if it has one, its move constructor (declared or implicit, [class.copy.ctor]p8), whether moving it cannot throw, whether it has a move assignment operator, whether it declares a move constructor or move assignment operator (its implicit copies are then deleted, [class.copy.ctor]p6, [class.copy.assign]p2) and whether it has a copy assignment operator, its virtual functions (declared or inherited) and the pure ones it does not override (by identity, the name with the parameter types and the const of this), the identity of each member function by the name it is lowered to, the names it brings in from its bases with using-declarations (each with the base), the virtual bases of its hierarchy in the order a complete object constructs them, its static members, and whether an object of it can be default-initialized (its implicit default constructor is deleted when a member cannot be, [class.default.ctor]p2.4).

data CppType

C++’s types, each with one child: a reference to it (it holds the address of what it refers to), an rvalue reference to it (held the same way, [dcl.ref]p2), and a parameter of a class passed by value through the address of the caller’s copy (the Itanium C++ ABI’s invisible reference, for one with a copy constructor or a destructor).

data CppReason

Why a C++ run notes a divergence or stops: a named object returned without copying it, as clang does, where the standard also allows the copy and the output depends on which ([class.copy.elision]p1); a pure virtual function called, during construction or destruction ([class.abstract]p6, undefined); an exception no handler caught (std::terminate, [except.terminate]); a termination whose output depends on whether the stack was unwound first (implementation-defined, [except.terminate]p2); a name the program declares that a header may also bring into std through others ([res.on.headers]p1, under using namespace std).

data CppExpr

C++’s expressions: the object containing a base class subobject, steps levels up (a pointer to a base converted to a pointer to a derived class, [expr.static.cast]p11); the exception being handled (a pointer to it); whether std::cin has not failed (while (std::cin >> x)); the address of an object whose resources may be taken (the one operand, as it is: what it points to is an xvalue, [basic.lval]p1.3); the environment’s clock and inputs; the next byte of standard input without taking it (-1 when there is none) and how many are left; whether a pointer points to one of the n elements from another; a byte of the EEPROM.

record Thrown

An exception object: its block, the type names a handler can catch it by (its own, then its bases’), the name an uncaught one is reported by, the path to the subobject the handler that caught it refers to, and, for a pointer caught as a pointer to a base, the block of the converted pointer the handler gets.

record TimedInput

An input the host gives the program’s environment: from the time at (microseconds) on, the key (analog:14, dht.temperature:7: a kind and an index) has the value (an integer or a floating value).

record PinChange

A change of a pin’s value the host is shown: when (microseconds), the pin, the value.

record PinDrive

A chip driving a pin from a time on (__cella_drive): the level (0 or 1; -1 lets it go, to the pull-up or the host).

record Environment

What a program’s environment holds for its primitives (cpp.primitives): the simulated time, in microseconds; the inputs the host gives (in the order of their times); what the host is shown (kind:index and its latest value, or text, in the order each key was first shown); the pins’ changes (the earliest first) and whether some were left out past the limit; the declarations of the objects named for kind:index (empty for one no declaration owns: allocated); the EEPROM’s bytes written (address and byte, the first write of each address first; one never written is 0xFF); the chips’ drives of pins (__cella_drive, in the order made). A program without a board has the same environment and never uses it.

def Environment.given (inputs : List TimedInput) : Environment

The environment a run starts in: time 0, with the host’s inputs.

def Environment.initial : Environment

The environment of a run without inputs.

record CppState

C++‘s run state: the streams’ format, the exception on its way out (if any), the exceptions being handled (the innermost first; throw; throws the first again), the program’s environment.

def CppState.initial : CppState

The state a run starts in.

record CppTables

C++‘s tables: the classes’ members and their access, the function templates (name, parameters, definition), the class templates (name, parameters, an empty class: an instance’s name leaves out the arguments that are defaults), the names of the operator functions the classes declare, whether some class has a conversion function, and whether some class without operator= has a converting constructor (the last three let an operator or an assignment decide at once that it is not one of those, without checking its operands), and each class’s friends ([class.friend]: the functions it names, as the functions are lowered, and the classes).

data CppRequest

What C++’s checking asks for: the instance of a function template for these template arguments; the result type of a lambda’s class (cpp.lambdas), deduced from a return.

def Cpp.constructs : Constructs

C++’s constructs.

def Operators.binaryName (op : BinaryOp) : String

The name of a binary operator’s function, if it can be overloaded.

def Operators.unaryName (op : UnaryOp) : String

The name of a unary operator’s function.