standardfunctions
cpp.StandardFunctions.called
Section titled “cpp.StandardFunctions.called”def StandardFunctions.called (items : List Item) : List StringThe names of the functions the items call (each call once, in order; one walk over the items).
cpp.StandardFunctions.calls
Section titled “cpp.StandardFunctions.calls”def StandardFunctions.calls (called : List String) (f : String) : BoolWhether a function of a name is among the called ones.
cpp.StandardFunctions.fresh
Section titled “cpp.StandardFunctions.fresh”def StandardFunctions.fresh (head : String) (it : Item) : ItemA generated item with fresh nodes under a head.
cpp.StandardFunctions.choosing
Section titled “cpp.StandardFunctions.choosing”def StandardFunctions.choosing (name : String) (secondWins : Expr -> Expr -> Expr) : Itemtemplate <typename T> const T &std::max(const T &a, const T &b) (or min): the second when it wins.
cpp.StandardFunctions.abs
Section titled “cpp.StandardFunctions.abs”def StandardFunctions.abs (t : TypeSyntax) (floating : Bool) : ItemT std::abs(T x) for the type t: the integer’s magnitude (as C’s abs, undefined for the most negative), a
floating value’s fabs (long double’s is not decided: fabs of a long double, CheckDialect.wantsLongDoubleMath).
cpp.StandardFunctions.classifying
Section titled “cpp.StandardFunctions.classifying”def StandardFunctions.classifying (name : String) : Itembool std::isnan(long double x), bool std::isinf(long double x) ([c.math.fpclass]) for the classification name:
a NaN is the value not equal to itself; an infinity is a value equal to itself whose difference with itself is a NaN
(inf - inf). A float, a double or an integer is converted to long double first, which keeps its value (long double
holds every double), so one function serves the overloads.
cpp.StandardFunctions.removeReference
Section titled “cpp.StandardFunctions.removeReference”def StandardFunctions.removeReference : List Itemstd::remove_reference<T>::type ([meta.trans.ref]) as the standard defines it: a class template whose member
type is T, with partial specializations for T & and T &&.
cpp.StandardFunctions.removed
Section titled “cpp.StandardFunctions.removed”def StandardFunctions.removed : TypeSyntaxThe referred type of T, typename std::remove_reference<T>::type.
cpp.StandardFunctions.move
Section titled “cpp.StandardFunctions.move”def StandardFunctions.move : Itemtemplate <class T> typename remove_reference<T>::type &&std::move(T &&t): an xvalue of what t refers to
([forward]p8).
cpp.StandardFunctions.forward
Section titled “cpp.StandardFunctions.forward”def StandardFunctions.forward : Itemtemplate <class T> T &&std::forward(typename remove_reference<T>::type &t): t as T says it was passed, an lvalue
for T = U & and an xvalue otherwise ([forward]p2; T is written, not deduced).
cpp.StandardFunctions.classifications
Section titled “cpp.StandardFunctions.classifications”def StandardFunctions.classifications : List StringThe
cpp.StandardFunctions.math
Section titled “cpp.StandardFunctions.math”def StandardFunctions.math : List StringThe
cpp.StandardFunctions.generated
Section titled “cpp.StandardFunctions.generated”def StandardFunctions.generated : List StringThe functions this branch generates when called (std’s own templates and overloads).
cpp.StandardFunctions.fromC
Section titled “cpp.StandardFunctions.fromC”def StandardFunctions.fromC : List StringC’s library functions written with std:: (std::abs is C++’s overloads, std::isnan
C++’s function).
cpp.StandardFunctions.provided
Section titled “cpp.StandardFunctions.provided”def StandardFunctions.provided : List StringThe functions this branch provides under std, by their unqualified names: those it generates when called, the
using namespace std; makes them visible without std::).
cpp.Braced.elements
Section titled “cpp.Braced.elements”def Braced.elements (xs : List Init) : Option (List Expr)The expressions of a braced list’s elements, when each is an expression (no braces or designators inside).
cpp.StandardFunctions.writesItself
Section titled “cpp.StandardFunctions.writesItself”def StandardFunctions.writesItself (e : Expr) : BoolWhether an expression changes something itself (an assignment, an increment, input, new): as the argument of a
call it is unsequenced with the other arguments’ accesses, while a braced list’s elements are sequenced.
cpp.StandardFunctions.extremesOfList
Section titled “cpp.StandardFunctions.extremesOfList”def StandardFunctions.extremesOfList (e : Expr) : Exprmin({a, b, c}) and max({…}) in e (their initializer_list versions, [alg.min.max]) as the two-argument ones from
the left, min(min(a, b), c): the same value, the first of equal ones as min_element gives. The list evaluates its
elements in order and the nested calls’ arguments are indeterminately sequenced: with calls in the elements the value
is the same when their effects do not conflict, and the check reports the order when they do (never a wrong answer).
An element that changes something itself (StandardFunctions.writesItself) would be unsequenced there: that list is
left as it is.
cpp.StandardFunctions.prepare
Section titled “cpp.StandardFunctions.prepare”def StandardFunctions.prepare (p : Program) : ProgramThe std functions the items call, generated, and the items with std’s
cpp.StandardFunctions.bitwise
Section titled “cpp.StandardFunctions.bitwise”def StandardFunctions.bitwise (g : Globals Cpp.constructs) (t : Ty Cpp.constructs) : BoolWhether a type is exchanged bit for bit: no class, or a class without a copy constructor or destructor (its moves are bit for bit too).
cpp.StandardFunctions.hiddenVariable
Section titled “cpp.StandardFunctions.hiddenVariable”def StandardFunctions.hiddenVariable (m : NodeId) (hidden : DeclId) : ExprThe hidden variable a swap holds a copy in.
cpp.StandardFunctions.swap
Section titled “cpp.StandardFunctions.swap”def StandardFunctions.swap (types : TypeExtension Cpp.constructs) (checker : Checker Cpp.constructs) (statements : StatementChecker Cpp.constructs) (c : StatementContext Cpp.constructs) (env : Env Cpp.constructs) (n : NodeId) (m : NodeId) (a : Expr) (b : Expr) : CheckResult Cpp.constructs (TypedStmt Cpp.constructs)std::swap(a, b) as a statement.
cpp.StandardFunctions.explicitSwap
Section titled “cpp.StandardFunctions.explicitSwap”def StandardFunctions.explicitSwap (types : TypeExtension Cpp.constructs) (checker : Checker Cpp.constructs) (statements : StatementChecker Cpp.constructs) (c : StatementContext Cpp.constructs) (env : Env Cpp.constructs) (n : NodeId) (m : NodeId) (w : TypeSyntax) (a : Expr) (b : Expr) : CheckResult Cpp.constructs (TypedStmt Cpp.constructs)std::swap<W>(a, b), the template argument written ([temp.arg.explicit]): with T = W the first overload takes two
lvalues of type W (T &), the array overload two arrays of W of the same length (T (&)[N], N deduced); either is the
swap of std::swap(a, b). W const (not move-assignable, [utility.swap]p1) or an argument of another type matches
neither: no matching function. A reference written as W is not done. The statement n calls at the node m with w
written as W, checked by checker and statements (the types by types) in the context c and the scope env.
cpp.StandardFunctions.statement
Section titled “cpp.StandardFunctions.statement”def StandardFunctions.statement (types : TypeExtension Cpp.constructs) (checker : Checker Cpp.constructs) (statements : StatementChecker Cpp.constructs) (c : StatementContext Cpp.constructs) (env : Env Cpp.constructs) (s : Stmt) : Option (CheckResult Cpp.constructs (TypedStmt Cpp.constructs))The std functions checked as statements: std::swap(a, b) and std::swap<T>(a, b) as the statement s, checked by
checker and the statements’ checker (the types by types) in the context c and the scope env; none for any other.