- Document
- Cpp Next
- Date
- Authors
- Miriam Castellanos,
Tobias Mwangi - Reply-to
- hello@cpp-next.com
Old C++ questions, answered again for the standard you compile with
Proposed wording
what you learned the answer today, underlined in the colour of the standard that changed it: 111417202326
A string the function keeps is taken
byconst std::string&and copiedby value and moved into place: name_ = std::move(n);since C++11
A string the function only reads is passed as
const std::string&std::string_view.since C++17
A value is printed
by chainingstd::cout <<with std::println("x = {}", x);since C++23; with
std::formatsince C++20
Cpp Next is for developers who write C++ for a living and suspect the advice they learned has aged. Every guide names the standard it is written for, and Since When tells you which standard and compiler a feature needs.
Scope
Since When. C++11 to C++26, feature by feature: the standard that added it and the first GCC, Clang and MSVC releases.
Guides in eight sections. Language, standard library, templates, performance, concurrency, tooling, standards and careers.
Toolchain. The compilers, build tools, analyzers and IDEs a C++ team would install, each with its price.
Contents
Back to C++ after years away? Start with Language. Choosing a build system or an analyzer? Tooling. Planning a move to C++23? Standards.
Since When Annex A, the first row of each table
- Move semantics (rvalue references)C++11GCC 4.3Clang 2.9MSVC VS 2015
- Generic lambdasC++14GCC 4.9Clang 3.4MSVC VS 2015
- Structured bindingsC++17GCC 7Clang 4MSVC VS 2017 15.3
- ConceptsC++20GCC 10Clang 10MSVC VS 2019 16.3
- Deducing
this(explicit object parameters)C++23GCC 14Clang 18MSVC VS 2022 17.13 std::inplace_vectorC++26GCC 16.1Clang Not yetMSVC Not yet