Answers
Newest first. When a later standard changes an answer, the article is updated in place and says what changed and since when.
Each answer names the standard it is written for: 111417202326
- Document
- Answers
- Answers
- 105, newest first
- Page
- 11 of 11
- Written by
- Miriam Castellanos
- Sections
- All eight
- Feed
- RSS
std::variantin C++:std::visit,std::getand the trapsCreate a
std::variant, read it withstd::get,get_iforstd::visit, catch the missing case a conversion hides, and see what it costs and when to skip it.written for C++17
std::vectorin C++: size, capacity, erase and reallocationstd::vectorsize against capacity, how each standard library grows it, what every member invalidates, and erase, find and sort, checked on four compilers.written for C++17
C++ try catch: how to throw and catch exceptions
C++ try, catch and throw: the syntax, why you catch by const reference, the order of handlers, your own exception type, and what happens when nothing catches.
written for C++17
using namespace std: what it does and what to write instead
What using namespace std does to name lookup, the clashes and silent overload changes it caused on four compilers, and what to write instead.
written for C++17
When to mark a move constructor noexcept in C++
Mark moves and swap noexcept when they cannot throw, or
std::vectorcopies where it could move. What is noexcept already, and how to check it at compile time.written for C++20