It's a standard-library requirement. 哈希容器的用户间接地使用哈希功能,不希望简单的操作发生异常。这是标准库的要求。 My_type{ "asdfg" }] << '\n'; } If you have to define a hash specialization, try simply to let it combine standard-library
copy x and y can be independent objects (value semantics, the way non-pointer built-in types and the standard-library Value semantics is the simplest to reason about and what the standard-library facilities expect.
The standard-library containers use unsigned subscripts. Thus, no perfect and fully compatible solution is possible (unless and until the standard-library containers use range-for 使用范围for use iterators/pointers 使用指针和迭代器 Enforcement(实施建议) Very tricky as long as the standard-library
publisher.join(); } Note(注意) With the exception of async(), the standard-library facilities are low-level argument for using higher level, more applications-oriented libraries (if possibly, built on top of standard-library
Note(注意) Many standard-library functions are noexcept including all the standard-library functions "inherited
catch(int i) { // i == 7 means "input buffer too small" // ... } } Note(注意) The standard-library Maybe warn about throw and catch using a standard-library exception type.
Note(注意) The ISO standard guarantees only a "valid but unspecified" state for the standard-library containers (Not enforceable) Look at the use of standard-library container types (incl. string) and consider them
Note(注意) The standard-library functions that apply to ranges of elements all have (or could have) bounds-safe v.at(0) = at(a, i); // OK (alternative 2) } Enforcement(实施建议) Issue a diagnostic for any call to a standard-library
This ensures consistency with standard-library types and follows the principle of "do as the ints do.
Note(注意) A few simple microbenchmarks using Unix time or the standard-library <chrono> can help dispel
The standard-library containers and algorithms will not work correctly if a swap of an element type fails
A non-throwing move will be used more efficiently by standard-library and language facilities.
A draft of a set of standard-library concepts can be found in another ISO TS: ranges Concepts are supported
For starters, we know about the standard-library containers, string, and smart pointers.
A draft of a set of standard-library concepts can be found in another ISO TS: ranges Concepts are supported
Bounds.4: Don't use standard-library functions and types that are not bounds-checked: Use the standard
Avoid this, even though the standard-library facets made this mistake.
(通常会包含泄露) Example(示例) The standard-library containers handle self-assignment elegantly and efficiently
If they do, basic standard-library invariants are broken. 标准库假设析构函数,内存释放函数(例如delete运算符),swap都不会抛出异常。
Realistic types, such as the standard-library iterators can be made to exhibit similar anti-social tendencies