Modern C++ Features: A Comprehensive Guide
Introduction to Modern C++ (C++11/14/17/20)
This guide documents key features from the Modern C++ Tutorial: Quick Start with C++11/14/17/20.
Chapter 2: Core Language Enhancements
Compile-time Constants with constexpr
The constexpr keyword allows expressions to be evaluated at compile time, enabling optimizations.
constexpr int fibonacci_sequenc ...
Posted on Mon, 18 May 2026 16:40:13 +0000 by keyurshah
Understanding std::any in Modern C++
Overview
C++17 introduced three utility types commonly referred to as the "trio": std::optional, std::any, and std::variant. This article focuses on std::any, a type-safe container designed to hold a single value of any copy-constructible type.
The class is defined in the <any> header:
namespace std {
class any;
}
Unlike templa ...
Posted on Fri, 08 May 2026 00:20:08 +0000 by saint4