Here is a list of "did you know..." or "tip of the day" statements about C++. They are intended to be informative and thought provoking without being very verbose.
- C++ first appeared in 1985
- C++ was first standardized in 1998
- A new version of C++ is released every 3 years since 2011
- C++14 can be considered a bugfix to C++11
- Lambdas are new types created for you by the compiler
- Only
::
,.
, and.*
operators cannot be overloaded - C++ is an ISO standard
auto
follows the same rules as template parameters[[nodiscard]]
makes it a warning to ignore a return value[[nodiscard]]
can be applied to both functions and typesstatic_assert
performs a compile-time check- There are 3 main currently maintained C++ compiler implementations
constexpr
functions may be evaluated at compile-timeconstexpr
values are evaluated at compile-timeconsteval
functions must be evaluated at compile-time-Wall
in GCC and Clang does not enable ALL warnings/Wall
in MSVC DOES enable ALL warnings- C++ has stricly defined object lifetime rules
if constexpr
allows for compile-time branchingstd::format
provides python-like string formatting for C++- C++23 added 2 new floating point types!
- In C++20,
virtual
functions can beconstexpr
enum struct
andenum class
are equivalent- Unions can have constructors and member methods
- You can use unary
operator+
to cast a stateless lambda to a function pointer - C++ got its OOP features from
Simula67
Programming language. - The
override
keyword was added to the language inC++11
.