Tag: C++14
5 posts
-
C++ Generic Lambdas — auto Parameters and Template Lambdas
Generic lambdas in C++14: auto makes operator() a template, C++20 template lambdas, STL patterns, deduction rules, performance, and common pitfalls.
-
C++14 Init Capture: Moving unique_ptr into Lambdas, Reference Init and Evaluation Time
C++14 init capture [x = expr]: auto-style deduction, when it runs, moving unique_ptr in, why std::function rejects it, [&r = x], [*this] and pack capture.
-
Modern C++ Syntax Cheatsheet: C++11 to C++20 Features and Their Pitfalls
Scannable modern C++ reference: each C++11/14/17/20 feature with the standard that added it, a snippet verified on g++ 10.3, and the pitfall that bites.
-
C++ constexpr Functions and Variables: Compute at Compile
Compute values at compile time with constexpr: C++14/20 rule changes, constexpr vs const, a CRC32 lookup table, and fixes for ten common constexpr errors.
-
C++ std::chrono::duration: Units, Literals, and Safe Conversions
Working with std::chrono::duration in C++ - representing time intervals, chrono literals like 500ms and 2h, converting between units safely, C++20 calendar literals, and avoiding truncation bugs.