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
- 23, newest first
- Page
- 1 of 3
- Written by
- Miriam Castellanos,
Tobias Mwangi - Sections
- All eight
- Feed
- RSS
Can a C++ destructor throw? What happens since C++11
Since C++11 a throwing destructor calls
std::terminate. Whatnoexcept(false)changes, why containers forbid it, and how to report failure fromclose().written for C++20
Clang vs GCC: what differs for a C++ project
Clang vs GCC for C++: default standard, libstdc++ or libc++, C++26 features and warnings, each built on GCC 16.2 and Clang 23.1, then tools and which to pick.
written for C++23
C++ expression templates explained with a C++20 example
Build a C++20 expression template that runs a + b + c in one loop with no temporaries, count what it removes, and see when Eigen or ranges fit better.
written for C++20
C++ generators:
co_yieldandstd::generatorWrite a lazy sequence with
co_yield:std::generatorin C++23, a complete C++20 generator for libraries without it, and the lifetime rules that stop dangling.written for C++23
C++ int to string:
to_string, format orto_chars, not itoaConvert an int to a string in C++ with
std::to_string,std::formatorstd::to_chars: the exact output of each, what allocates, and why itoa is not standard.written for C++17
Strings as C++ template parameters with C++20
fixed_stringA string literal can’t be the argument of a pointer template parameter. How a C++20
fixed_stringtype fixes that, what came before, and what C++26 adds.written for C++20
C++ string to int:
std::stoiorstd::from_chars, not atoiConvert a string to int in C++ with
std::stoiorstd::from_chars, reject trailing text, and see what each call, atoi included, does with bad input.written for C++17
C++ virtual functions: override, pure virtual and the traps
How a C++ virtual function call is resolved, why to write override and a virtual destructor, pure virtual functions, and which warnings catch the traps.
written for C++11
C++ vs C: what differs, what breaks, which to choose
C++ vs C in compiled code: the valid C that four compilers reject as C++, how C23 moved toward C++, how extern “C” joins the two, and when to pick C.
written for C++23
C++20 concepts: how to write and use them
Constrain C++20 templates with concepts: the four ways to write a constraint, requires expressions, the standard concepts, overloading, and what is not checked.
written for C++20