Blog
-
C++ std::optional vs Pointers: Representing No Value
std::optional vs nullptr: optional models absent values with type safety; pointers for non-owning observers, polymorphism, and shared ownership.
-
C++ std::function vs Function Pointers: Flexibility vs Speed
std::function vs raw function pointers: pointers are faster and smaller; std::function type-erases lambdas with captures and functors.
-
C++ decltype | Extract Expression Types
decltype vs auto, decltype(auto), trailing return types, SFINAE with decltype, and the decltype(x) vs decltype((x)) pitfall for templates.
-
C++ Header Files : Declarations, Include Guards, and What
How C++ headers declare APIs while .cpp files define behavior: ODR-safe patterns, include guards, forward declarations, templates, inline functions.
-
C++ `if constexpr` | Compile-Time Branching in Templates
Use `if constexpr` to discard untaken branches during instantiation—unlike runtime `if`, avoiding ill-formed code in unused branches for templates.
-
C++ Initializer-List Constructors
Constructors taking std::initializer_list enable `{1,2,3}` initialization.
-
C++ RVO and NRVO | Return Value Optimization Complete Guide
RVO vs NRVO: when the compiler elides copies on return, C++17 guaranteed elision for prvalues, NRVO heuristics, and interaction with move semantics.
-
Google Test for C++: From Setup to TEST, Fixtures, and CI
Complete C++ unit testing guide with Google Test: FetchContent and vcpkg setup, TEST and TEST_F, EXPECT vs ASSERT, parameterized tests, death tests, TDD...
-
Boost Libraries for C++: Asio, Filesystem, Regex, DateTime,
Complete Boost guide: Install with apt or vcpkg, use Boost.Asio for async I/O, Filesystem for portable paths, Regex for pattern matching, DateTime for c...
-
Build a C++ Chat Server: Multi-Client Broadcast with
Complete chat server guide: ChatRoom with strand-serialized join/leave/deliver, Session with async_read_until and write queues, join/leave system messag...