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(...
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)
Enlaces externos − Bibliotecas no ANSI/ISO − Índice − Índice de símbolos Novedades 2025 biblioteca de rangos (en curso), biblioteca de iteradores (en curso) Obtenido de «https://es.cppreference.com/mwiki/index.php?title=Página_principal&oldid=44663» Navegación...
Rectifying constant iterators, sentinels, and ranges, that is, ranges::cbegin and other similar utilities returning constant iterators should be fully guaranteed even for shallow-const views (such as std::span) (P2278R4) Making multi-param constructors of some views explicit (P2711R1) ...
constexpr auto /*as-const-pointer*/( const T* p ) noexcept { return p; } (2) (仅用于阐述*) 某些范围访问定制点对象是根据这些仅用于阐述的函数模板指定的。 1) /*possibly-const-range*/ 在是深 const 范围时返回 const 限定的范围 r;否则,返回不进行任何转型的 r。 2) /*as-const-pointe...
__cpp_lib_ranges_as_const std::const_iterator、std::ranges::as_const_view 202207L (C++23) P2278R4 使std::basic_const_iterator 遵守其底层类型的可转换性 202311L (C++26) P2836R1 __cpp_lib_ranges_as_rvalue std::ranges::as_rvalue_view 202207L (C++23) P2446R2 __cpp_lib_rang...
The storage of the vector is handled automatically, being expanded as needed. Vectors usually occupy more space than static arrays, because more memory is allocated to handle future growth. This way a vector does not need to reallocate each time an element is inserted, but only when the additi...
3) 非类[non-class]的纯右值不能被const或volatile关键字标识[cv-qualified]。 4) 纯右值不能有不完整的型别[type]。除非[except]它是void类型或者用于decltype说明符[specifier]时。 xvalue【since C++11】 x值[xvalue, expiring value]表达式是既有“身份”[has identify],也能够“被移动”[can be moved...
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...
Note that care must be used when checking this status as, without synchronization, the returned status may no longer be accurate the instruction after it is read. (Inherited from DkmDataContainer) Qualifiers const/volatile qualifiers on this type. This API was introduced i...