ConstWarning: This wiki is part of the deprecated and unmaintained CppReference Book project. For up-to-date information on C++, see the main reference at cppreference.com. As we have seen in the last chapter, there are mainly two reasons to pass an argument to a function by reference:...
clear(); // OK // constRef.clear(); // Error: 'constRef' is 'const' qualified, // but 'clear' is not marked const assert(&constRef == &mutableString); assert(&std::as_const(mutableString) == &mutableString); using ExprType = std::remove_reference_t<decltype(std::as_const(...
2) 拥有左值[glvalue]表达式的所有属性。 [注] 类似于纯右值,x值绑定右值引用,但不同的是,x值可能是多态的[polymorphic],并且非类[non-class]的x值可能被const或volatile关键字标识[cv-qualified]。 混合值类型(maxed gategories) glvalue 广义左值[泛左值, glvalue, generalized left value]表达式是一个左值...
1) /*possibly-const-range*/ 在是深 const 范围时返回 const 限定的范围 r;否则,返回不进行任何转型的 r。 2) /*as-const-pointer*/ 返回常量类型对象的指针。 范围适配器辅助模板 template< class F, class Tuple > constexpr auto /*tuple-transform*/( F&& f, Tuple&& tuple ) { return std::ap...
atômicas(C11) Biblioteca de suporte de thread(C11) Especificações técnicas Dynamic memory extensions(dynamic memory TR) Floating-point extensions, Part 1(FP Ext 1 TS) Floating-point extensions, Part 4(FP Ext 4 TS) Links Externos−Bibliotecas Não-ANSI/ISO−Index−Index de Símbol...
propagate_const−ostream_joiner−randint observer_ptr−Detection idiom Standard library extensions v3(library fundamentals TS v3) scope_exit−scope_fail−scope_success−unique_resource Parallelism library extensions v2 (parallelism TS v2)
ct,与t指代同一对象的constT类型左值(等价于 C++17 起的std::as_const(t)) element_type,对象类型 下列表达式必须合法并拥有其指定的效果: 表达式返回类型前条件操作语义 t.get()element_type* ct.get()element_type*或constelement_type*t.get()==ct.get() ...
Same as rvalue (below). A prvalue cannot be polymorphic: the dynamic type of the object it identifies is always the type of the expression. (纯右值不能是动态类型) A non-class non-array prvalue cannot be cv-qualified. (不是class也不是数组的纯右值不能声明为const, volatile, const-volatil...
Same as rvalue (below). A prvalue cannot be polymorphic: the dynamic type of the object it identifies is always the type of the expression. (纯右值不能是动态类型) A non-class non-array prvalue cannot be cv-qualified. (不是class也不是数组的纯右值不能声明为const, volatile, const-volatil...
DRApplied toBehavior as publishedCorrect behavior LWG 307C++98std::queuedid not support containers using proxy reference types[1]in place of (const)value_type&supported LWG 2566C++98Missing the requirement forContainer::value_typeill-formed ifTis not the same type asContainer::value_type ...