Tag: C++17
31 posts
-
C++ string vs string_view: Fast, Non-Owning String Handling (C++17)
std::string vs std::string_view: avoid copies in read-only APIs, allocation costs, lifetime rules, substring performance, and null-termination caveats.
-
C++ std::optional vs Pointers: Representing 'No Value' Safely
std::optional vs nullptr: optional models absent values with type safety; pointers for non-owning observers, polymorphism, and shared ownership. Stack-f...
-
[2026] C++ RVO and NRVO: Copy Elision, Performance, and Why `return std::move` Hurts
RVO vs NRVO, C++17 guaranteed elision for prvalues, why std::move on return blocks NRVO, benchmarks, and a practical checklist.
-
C++ any | 'Type Erasing' Guide
A guide that summarizes std::any and variant·void* comparison, type safety, any_cast, practical examples, and performance overhead.
-
Modern C++ (C++11~C++20) Core Syntax Cheatsheet | auto·Lambda·Smart Pointers·Concepts at a Glance
Modern C++ C++11~C++20 core syntax cheatsheet. auto, range-for, lambda, smart pointers, optional, variant, Concepts, Ranges copy-paste ready summary for...
-
C++ CTAD | Class Template Argument Deduction (C++17)
Learn C++17 CTAD: omit template arguments for `pair`, `vector`, and custom types. Deduction guides, `explicit` constructors, and common pitfalls with `i...
-
C++ std::variant vs union Complete Comparison | Type-Safe vs Unsafe Sum Types
Master C++ sum types: std::variant (type-safe, std::visit, exceptions) vs union (unsafe, manual tracking, legacy). Complete comparison with use cases, p...
-
C++ std::any vs void* Complete Comparison | Type-Safe vs Unsafe Type Erasure
Master C++ type erasure: std::any (type-safe, runtime checks, exceptions) vs void* (unsafe, manual casting, legacy). Complete comparison with use cases,...
-
C++ constexpr Lambda | 'Compile-Time Lambda' Guide
Everything about C++ constexpr Lambda : from basic concepts to practical applications. Master key content quickly with examples.'Compile-Time Lambda' Gu...
-
C++ Copy Elision | When Copies and Moves Disappear
Copy elision: RVO, NRVO, C++17 guaranteed elision for prvalues, parameter initialization, and why returning local variables with std::move often hurts.
-
C++ Deduction Guides: Customizing CTAD in C++17
Deduction guides for CTAD: syntax, iterator pairs, const char* to string conversions, explicit guides, and pitfalls with ambiguous overloads.
-
C++ directory_iterator | Traverse folders with std::filesystem
directory_iterator vs recursive_directory_iterator, directory_options, symlinks, error_code overloads, filtering, disk usage, and performance tips for C...
-
C++ Execution Policies | Parallel and Vectorized STL (C++17)
std::execution::seq, par, par_unseq: when parallel algorithms help, data races, exceptions, and profiling parallel sort and reduce.
-
C++ File Operations | 'File Operations' Guide
Everything about C++ File Operations : from basic concepts to practical applications. Master key content quickly with examples.'File Operations' Guide. ...
-
C++ File Status | 'File Status' Guide
C++17 std::filesystem file_status·perms, status and symlink_status, file_type·permission checks, backup·log cleanup practice, Windows and POSIX differen...
-
C++ Filesystem Explained | std::filesystem (C++17) guide
std::filesystem (C++17) handles paths, directories, copy, and delete in the standard library. path, exists, create_directory, copy, and namespace usage with examples.
-
C++ Fold Expressions | Folding Parameter Packs in C++17
C++17 fold expressions explained: unary/binary folds, left vs right, empty packs, supported operators, and patterns for sum, print, all_of, and containers.
-
C++ `if constexpr` | Compile-Time Branching in Templates (C++17)
Use `if constexpr` to discard untaken branches during instantiation—unlike runtime `if`, avoiding ill-formed code in unused branches for templates.
-
C++ std::optional Complete Guide | nullopt, Monadic Ops (C++23), and Patterns
std::optional vs nullptr and exceptions: value_or, and_then, transform, or_else, performance, and production error-handling patterns (C++17–C++23).
-
C++ Parallel Algorithms | Parallel Algorithm Complete Guide
C++ Parallel Algorithms: execution policy, parallel arrangement, principles, code, and practical applications. Start now.
-
C++ std::filesystem::path | Cross-platform paths in C++17
Use std::filesystem::path to join, normalize, and inspect paths portably. Covers filename, extension, parent_path, absolute, canonical, weakly_canonical...
-
C++ Range-Based for: auto, References, Temporaries, Structured Bindings — Practical Guide
Range-based for in C++: auto vs auto& vs const auto&, proxy iterators, temporaries, C++17 structured bindings, custom begin/end, and production patterns.
-
[2026] C++ scoped_lock — Scoped locking, std::lock, and deadlock avoidance
std::scoped_lock (C++17) is an RAII lock that locks multiple mutexes at once via std::lock. Differences from lock_guard and unique_lock, deadlock avoidance, and patterns.
-
C++ [[nodiscard]] Guide: Ignore Return Values Safely | Errors, RAII & Reasons [#41-2]
Complete guide to C++ [[nodiscard]]: stop ignored return values, error codes, RAII guards, and C++20 reason strings. Compiler checks, examples, and CI patterns.
-
C++ Structured Bindings (C++17): Tuples, Maps, and auto [a,b]
C++17 structured bindings: decomposing tuple, pair, array, aggregates; auto&, const auto&; map iteration; pitfalls with temporaries; custom get protocol.
-
C++ tuple apply | 'Application of tuples' guide
Everything about C++ tuple apply : from basic concepts to practical applications. Master key content quickly with examples.'Tuple application' guide. Wh...
-
Advanced C++ Variadic Templates | Pack Expansion and Fold Expressions
Deep dive into variadic templates: parameter packs, expansion patterns, C++17 folds, and practical tips for logging, type lists, and perfect forwarding.
-
C++ variant | Type-safe union Complete Guide
std::variant is a type-safe union introduced in C++17. It can store a value of one of several types, and keeps track of which type it is currently stori...s union, it provides type safety and automatic life cycle management.
-
C++ std::filesystem Complete Guide | Cross-Platform Path, Directory, File Operations [#37-1]
Master C++ std::filesystem: fix Windows vs POSIX path bugs with path operations, directory iteration (recursive), file copy/move/delete, permissions, er...
-
C++ std::filesystem Complete Guide | Cross-Platform Path, Directory, File Operations [#37-1]
Master C++ std::filesystem: fix Windows vs POSIX path bugs with path operations, directory iteration (recursive), file copy/move/delete, permissions, er...
-
What Is C++? History, Standards (C++11–23), Use Cases, and How to Start
C++ overview for beginners: evolution from C, C++11/17/20/23, game/systems/finance use cases, pros and cons, myths, learning roadmap, and production pat...