<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Cpp Next</title><description>Since When: the standard and first GCC, Clang and MSVC releases for each C++ feature, and guides that answer old C++ questions for today’s standards.</description><link>https://cpp-next.com</link><language>en-us</language><managingEditor>hello@cpp-next.com (Miriam Castellanos)</managingEditor><item><title>assert in C++: how assert and static_assert work</title><link>https://cpp-next.com/blog/assert-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/assert-in-cpp</guid><description>assert in C++ explained: what a failed assert prints, how to add a message, how NDEBUG turns it off, and how static_assert checks at compile time.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>assert</category><category>static-assert</category><category>ndebug</category><category>error-handling</category><category>cpp17</category></item><item><title>Best C++ IDE: which to install on Windows, Mac or Linux</title><link>https://cpp-next.com/blog/best-cpp-ide</link><guid isPermaLink="true">https://cpp-next.com/blog/best-cpp-ide</guid><description>The best C++ IDE for Windows, Mac or Linux: Visual Studio, VS Code, CLion, Xcode or Qt Creator, where each runs, what is free, and IDE vs compiler.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Tooling</category><category>ide</category><category>visual-studio</category><category>vs-code</category><category>clion</category><category>cpp17</category></item><item><title>Binary search in C++: code and std::binary_search</title><link>https://cpp-next.com/blog/binary-search-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/binary-search-cpp</guid><description>Binary search in C++: a loop that returns the index, the recursive version, std::binary_search and lower_bound, and why the range must be sorted.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>binary-search</category><category>std-binary-search</category><category>std-lower-bound</category><category>algorithms</category><category>cpp17</category></item><item><title>bool in C++: true, false and how to use them</title><link>https://cpp-next.com/blog/bool-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/bool-in-cpp</guid><description>bool in C++ explained: true and false, what produces a bool, why cout prints 1 or 0, what converts to bool, bool functions and the common mistakes.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>bool</category><category>logical-operators</category><category>implicit-conversions</category><category>cpp17</category></item><item><title>cin in C++: read numbers, words and lines</title><link>https://cpp-next.com/blog/cin-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/cin-in-cpp</guid><description>cin in C++ reads what the user types: one value or several with &gt;&gt;, a whole line with getline, and how to fix cin after a letter breaks the read.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-cin</category><category>user-input</category><category>error-handling</category><category>cpp17</category></item><item><title>clang-format: format C++ with a .clang-format file</title><link>https://cpp-next.com/blog/clang-format</link><guid isPermaLink="true">https://cpp-next.com/blog/clang-format</guid><description>clang-format lays out C++ code in one command: where the .clang-format file goes, the seven styles, the options people change and a CI check.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Tooling</category><category>clang-format</category><category>code-style</category><category>llvm</category><category>cpp17</category></item><item><title>What is CMake? A build system generator, explained</title><link>https://cpp-next.com/blog/cmake</link><guid isPermaLink="true">https://cpp-next.com/blog/cmake</guid><description>What is CMake? A build system generator, shown with a CMakeLists.txt that builds, the two commands, cmake clean, CMake vs Make, a library and Release.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Tooling</category><category>cmake</category><category>build-systems</category><category>ninja</category><category>cpp17</category></item><item><title>Compile C++ with GCC: g++ commands and flags</title><link>https://cpp-next.com/blog/compile-cpp-with-gcc</link><guid isPermaLink="true">https://cpp-next.com/blog/compile-cpp-with-gcc</guid><description>How to compile C++ with GCC: the g++ command, choosing the C++ standard, the flags a beginner needs, several files, installing GCC and the common errors.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Tooling</category><category>gcc</category><category>compilers</category><category>compiler-flags</category><category>build-process</category><category>cpp17</category></item><item><title>Compiler vs interpreter: what is the difference?</title><link>https://cpp-next.com/blog/compiler-vs-interpreter</link><guid isPermaLink="true">https://cpp-next.com/blog/compiler-vs-interpreter</guid><description>Compiler vs interpreter: the same program run both ways in C++ and Python, when each one finds an error, why Python is both, and what JIT compilation is.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Tooling</category><category>compilers</category><category>interpreters</category><category>build-process</category><category>cpp17</category></item><item><title>const in C++: variables, pointers, references, methods</title><link>https://cpp-next.com/blog/const-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/const-in-cpp</guid><description>What const means in C++ on a variable, a pointer, a reference and a member function, with the error the compiler gives for each, and const vs constexpr.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>const</category><category>pointers</category><category>member-functions</category><category>constexpr</category><category>cpp17</category></item><item><title>constexpr in C++: variables, functions and static constexpr</title><link>https://cpp-next.com/blog/constexpr</link><guid isPermaLink="true">https://cpp-next.com/blog/constexpr</guid><description>What constexpr means in C++: constexpr variables and functions, constexpr vs const, static constexpr in a class and inline constexpr in a header.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>constexpr</category><category>const</category><category>consteval</category><category>compile-time</category><category>cpp17</category></item><item><title>C++ array: declare, initialize and get the length</title><link>https://cpp-next.com/blog/cpp-array</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-array</guid><description>How to declare and initialize a C++ array, loop over it, get its length with std::size, why sizeof fails in a function, and std::array vs vector.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>arrays</category><category>std-array</category><category>array-decay</category><category>cpp17</category></item><item><title>C++ class: how to define one and create objects</title><link>https://cpp-next.com/blog/cpp-class</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-class</guid><description>C++ class explained with one Account example: private data, public functions, objects, a constructor, const member functions, header files, class vs struct.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>classes</category><category>objects</category><category>access-specifiers</category><category>member-functions</category><category>cpp17</category></item><item><title>C++ constructor: default, parameterized, copy and move</title><link>https://cpp-next.com/blog/cpp-constructor</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-constructor</guid><description>What a C++ constructor is and how to write one: default, parameterized, copy and move constructors, the initializer list, explicit and structs.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>constructors</category><category>member-initializer-list</category><category>explicit</category><category>cpp11</category></item><item><title>continue in C++: skip to the next loop iteration</title><link>https://cpp-next.com/blog/cpp-continue</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-continue</guid><description>continue in C++: where each loop goes next, why a while loop with continue never ends, continue vs break, nested loops and switch.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>continue</category><category>break</category><category>loops</category><category>cpp17</category></item><item><title>C++ cout: how to print with std::cout</title><link>https://cpp-next.com/blog/cpp-cout</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-cout</guid><description>C++ cout prints text, numbers and variables with std::cout &lt;&lt;. End a line, fix the first errors, print two decimals with setprecision and print a bool.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-cout</category><category>iostream</category><category>iomanip</category><category>cpp17</category></item><item><title>C++ data structures: which container to use</title><link>https://cpp-next.com/blog/cpp-data-structures</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-data-structures</guid><description>C++ data structures in one table: the standard library container for each, its header and its cost, how to choose one, and what the library leaves out.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>data-structures</category><category>stl-containers</category><category>std-vector</category><category>std-map</category><category>cpp17</category></item><item><title>Data types in C++: int, double, char, bool and more</title><link>https://cpp-next.com/blog/cpp-data-types</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-data-types</guid><description>The C++ data types in one table: what int, double, char and bool hold, their sizes and ranges, how to check them with sizeof, and which one to use.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>data-types</category><category>sizeof</category><category>numeric-limits</category><category>cstdint</category><category>cpp17</category></item><item><title>C++ do while loop: syntax, examples and do while vs while</title><link>https://cpp-next.com/blog/cpp-do-while-loop</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-do-while-loop</guid><description>The C++ do while loop: its syntax and semicolon, do while vs while, a menu and an input check that survive a letter, and how break and continue behave.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>do-while</category><category>loops</category><category>user-input</category><category>cpp17</category></item><item><title>C++ enum and enum class: declare, convert, switch</title><link>https://cpp-next.com/blog/cpp-enum</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-enum</guid><description>C++ enum and enum class explained: the numbers behind the names, enum to int and back, a switch with no default, and printing an enum as a string.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>enum</category><category>enum-class</category><category>switch</category><category>cpp11</category></item><item><title>C++ friend class and friend function: syntax and rules</title><link>https://cpp-next.com/blog/cpp-friend-class</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-friend-class</guid><description>How to declare a C++ friend class and a friend function, print a class with operator&lt;&lt;, and why friendship is not mutual, inherited or transitive.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>friend-class</category><category>friend-function</category><category>access-control</category><category>cpp17</category></item><item><title>C++ function pointer: syntax, callbacks and examples</title><link>https://cpp-next.com/blog/cpp-function-pointer</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-function-pointer</guid><description>A C++ function pointer holds the address of a function. How to declare, assign and call one, alias it, pass it as a callback, and when to use std::function.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>function-pointers</category><category>callbacks</category><category>lambdas</category><category>cpp17</category></item><item><title>C++ functions: syntax, calling and overloading</title><link>https://cpp-next.com/blog/cpp-functions</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-functions</guid><description>C++ functions for beginners: the parts of a function, void, declaring before calling, pass by reference, default arguments and function overloading.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>functions</category><category>function-overloading</category><category>default-arguments</category><category>pass-by-reference</category><category>cpp17</category></item><item><title>C++ getline: how to read a whole line of input</title><link>https://cpp-next.com/blog/cpp-getline</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-getline</guid><description>C++ getline reads a whole line, spaces included, into a std::string. Why it seems skipped after cin &gt;&gt;, both fixes, and how to read a file or split a line.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-getline</category><category>std-cin</category><category>std-istringstream</category><category>cpp11</category></item><item><title>C++ header files: what goes in them, and what must not</title><link>https://cpp-next.com/blog/cpp-header-file</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-header-file</guid><description>What goes in a C++ header file and what in the .cpp, how to build the two, include guards or #pragma once, and the multiple definition error.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Tooling</category><category>header-files</category><category>include-guards</category><category>one-definition-rule</category><category>cpp17</category></item><item><title>C++ ifstream: how to open and read a file</title><link>https://cpp-next.com/blog/cpp-ifstream</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-ifstream</guid><description>C++ ifstream opens a file and reads it: a whole program that reads line by line, how to read words, numbers or all of it, and why your file does not open.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-ifstream</category><category>std-ofstream</category><category>file-io</category><category>cpp17</category></item><item><title>Inheritance in C++: base and derived classes</title><link>https://cpp-next.com/blog/cpp-inheritance</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-inheritance</guid><description>Inheritance in C++ with one Animal and Dog example: what a derived class inherits, public and private members, the base constructor, override and slicing.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>inheritance</category><category>classes</category><category>virtual-functions</category><category>cpp17</category></item><item><title>C++ initializer list: member lists and std::initializer_list</title><link>https://cpp-next.com/blog/cpp-initializer-list</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-initializer-list</guid><description>The two things a C++ initializer list means: the member initializer list after a constructor’s colon, its order rule, and std::initializer_list.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>member-initializer-list</category><category>std-initializer-list</category><category>constructors</category><category>cpp17</category></item><item><title>C++ iterator: how begin() and end() work</title><link>https://cpp-next.com/blog/cpp-iterator</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-iterator</guid><description>What a C++ iterator is and how to loop over a vector with one: begin() and end(), std::next and std::distance, erasing in a loop, and when one goes stale.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>iterators</category><category>std-vector</category><category>iterator-invalidation</category><category>cpp17</category></item><item><title>C++ linked list: write one, then use std::list</title><link>https://cpp-next.com/blog/cpp-linked-list</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-linked-list</guid><description>How to write a C++ linked list that frees its nodes, insert and delete nodes, then use std::list and std::forward_list, and when a vector is the better pick.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>linked-list</category><category>std-list</category><category>std-forward-list</category><category>data-structures</category><category>cpp17</category></item><item><title>C++ main function: int main(), argc and argv</title><link>https://cpp-next.com/blog/cpp-main</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-main</guid><description>The C++ main function: its two standard forms, why it returns int, whether you need return 0, how argc and argv work, and why void main is wrong.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>main-function</category><category>command-line-arguments</category><category>exit-status</category><category>cpp17</category></item><item><title>memcpy in C++: how std::memcpy works and when to use it</title><link>https://cpp-next.com/blog/cpp-memcpy</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-memcpy</guid><description>memcpy in C++: how std::memcpy counts bytes, which types it may copy, memmove for overlap, and when std::copy or std::bit_cast is the better call.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category><category>std-memcpy</category><category>std-memmove</category><category>std-bit-cast</category><category>cpp17</category></item><item><title>C++ namespace: declare, nest, alias and reopen</title><link>https://cpp-next.com/blog/cpp-namespace</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-namespace</guid><description>C++ namespace explained: declare one, reach its names with ::, reopen it across files, nest it in one line since C++17, alias it, make it file-private.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>namespaces</category><category>nested-namespace</category><category>unnamed-namespace</category><category>name-lookup</category><category>cpp17</category></item><item><title>C++ OOPs concepts: the four ideas, with code</title><link>https://cpp-next.com/blog/cpp-oops</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-oops</guid><description>C++ OOPs concepts in one Shape program: class and object, encapsulation, abstraction, inheritance and polymorphism, each with compiled code and its output.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>oop</category><category>classes</category><category>inheritance</category><category>polymorphism</category><category>cpp17</category></item><item><title>C++ operator overloading: signatures, member or friend</title><link>https://cpp-next.com/blog/cpp-operator-overloading</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-operator-overloading</guid><description>C++ operator overloading: member or hidden friend, a table of canonical signatures, == and &lt;=&gt; defaulted since C++20, &lt;&lt; and &gt;&gt; for streams.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>operator-overloading</category><category>three-way-comparison</category><category>hidden-friends</category><category>cpp20</category></item><item><title>C++ operator precedence: table, rules and pitfalls</title><link>https://cpp-next.com/blog/cpp-operator-precedence</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-operator-precedence</guid><description>C++ operator precedence in one table, with associativity, the bugs it explains (a &amp; b == c, cout &lt;&lt; x ? a : b, *p++) and why it is not evaluation order.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>operator-precedence</category><category>associativity</category><category>order-of-evaluation</category><category>cpp17</category></item><item><title>C++ operators: the full list with examples</title><link>https://cpp-next.com/blog/cpp-operators</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-operators</guid><description>C++ operators in one table with examples: arithmetic, assignment, ++ and --, comparison, logical, bitwise and XOR, and the mistake each group causes.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>operators</category><category>bitwise-operators</category><category>integer-division</category><category>cpp17</category></item><item><title>C++ pair: what std::pair is and how to use it</title><link>https://cpp-next.com/blog/cpp-pair</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-pair</guid><description>C++ pair explained: make a std::pair, read first and second, compare two pairs, sort a vector of pairs and loop over the pairs in a std::map.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-pair</category><category>make-pair</category><category>structured-bindings</category><category>std-map</category><category>cpp17</category></item><item><title>C++ queue: how std::queue works, with examples</title><link>https://cpp-next.com/blog/cpp-queue</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-queue</guid><description>How a C++ queue works: push, front and pop on std::queue, why pop() returns nothing, the empty-queue trap, looping, and queue vs stack, with examples.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-queue</category><category>std-stack</category><category>std-priority-queue</category><category>container-adaptors</category><category>cpp11</category></item><item><title>C++ random number: how to generate one in a range</title><link>https://cpp-next.com/blog/cpp-random-number</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-random-number</guid><description>How to use the C++ random number generator: std::mt19937 and uniform_int_distribution for a number in a range, a random double, the seed, and why not rand().</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>random-numbers</category><category>std-mt19937</category><category>uniform-int-distribution</category><category>std-shuffle</category><category>cpp11</category></item><item><title>C++ split string: 3 ways with code (getline, find, views)</title><link>https://cpp-next.com/blog/cpp-split-string</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-split-string</guid><description>C++ split string: a getline loop for one character, find and substr for a longer delimiter, std::views::split, and what each does with empty fields.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-string</category><category>string-split</category><category>std-getline</category><category>ranges</category><category>cpp17</category></item><item><title>Stack in C++: how std::stack works, with examples</title><link>https://cpp-next.com/blog/cpp-stack</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-stack</guid><description>How a stack in C++ works: push, top and pop on std::stack, the empty-stack rule, looping, stack vs queue, and two programs that use one.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-stack</category><category>container-adaptors</category><category>data-structures</category><category>cpp17</category></item><item><title>C++ string (std::string) explained with examples</title><link>https://cpp-next.com/blog/cpp-string</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-string</guid><description>How a C++ string (std::string) works: create one, get its length, concatenate, find text with find() and npos, and cut a substring, each with a program.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-string</category><category>string-view</category><category>string-concatenation</category><category>cpp17</category></item><item><title>C++ string comparison: ==, compare() and strcmp</title><link>https://cpp-next.com/blog/cpp-string-comparison</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-string-comparison</guid><description>C++ string comparison with ==, &lt;, compare() and strcmp: what each returns, why == fails on char pointers, and how to ignore case or check a prefix.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-string</category><category>string-comparison</category><category>strcmp</category><category>cpp17</category></item><item><title>C++ string concatenation: +, += and append()</title><link>https://cpp-next.com/blog/cpp-string-concatenation</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-string-concatenation</guid><description>C++ string concatenation with +, += and append(): which one to use, why “a” + “b” will not compile, and how to add a number or join strings in a loop.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-string</category><category>string-concatenation</category><category>cpp17</category></item><item><title>C++ string find: how to find a substring and check npos</title><link>https://cpp-next.com/blog/cpp-string-find</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-string-find</guid><description>C++ string find: what find() returns, why you test it against npos, contains(), every match, rfind, find_first_of and a search that ignores case.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-string</category><category>string-find</category><category>npos</category><category>cpp17</category></item><item><title>C++ string length: size(), length() and strlen</title><link>https://cpp-next.com/blog/cpp-string-length</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-string-length</guid><description>C++ string length with size(), length() and strlen: which one to call, why sizeof is not a length, and the size() - 1 trap on an empty string.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-string</category><category>string-length</category><category>strlen</category><category>cpp17</category></item><item><title>C++ struct vs class: the only two differences</title><link>https://cpp-next.com/blog/cpp-struct-vs-class</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-struct-vs-class</guid><description>C++ struct vs class: the two defaults that differ, for members and base classes, the errors they cause, what stays the same, and which keyword to write.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>struct</category><category>class</category><category>access-specifiers</category><category>inheritance</category><category>cpp17</category></item><item><title>C++ ternary operator (?:): syntax and examples</title><link>https://cpp-next.com/blog/cpp-ternary-operator</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-ternary-operator</guid><description>The C++ ternary operator (?:) explained: its syntax, how it differs from if-else, the type it returns, nesting, and the std::cout mistake to avoid.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>ternary-operator</category><category>conditional-operator</category><category>if-else</category><category>cpp17</category></item><item><title>C++ typedef: what it does and when to write using instead</title><link>https://cpp-next.com/blog/cpp-typedef</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-typedef</guid><description>What a C++ typedef does, how to write one for an array or a function pointer, why it is not a new type, and why new code writes using instead.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>typedef</category><category>type-alias</category><category>using</category><category>cpp17</category></item><item><title>C++ while loop (and do-while): syntax and examples</title><link>https://cpp-next.com/blog/cpp-while-loop</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-while-loop</guid><description>How the C++ while loop and do-while work: the syntax, reading input until it ends, break and continue, and the three reasons a loop never stops.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>while-loop</category><category>do-while</category><category>loops</category><category>cpp17</category></item><item><title>Destructor in C++: what it is and when it runs</title><link>https://cpp-next.com/blog/destructor-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/destructor-in-cpp</guid><description>What a destructor in C++ is, when it runs, the order objects are destroyed in, when to write your own and why a base class needs a virtual one.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>destructors</category><category>raii</category><category>virtual-destructor</category><category>rule-of-zero</category><category>cpp17</category></item><item><title>Pointers in C++: what they are and how they work</title><link>https://cpp-next.com/blog/pointers-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/pointers-in-cpp</guid><description>Pointers in C++ explained: what &amp; and * do, nullptr, pointers and arrays, pointer vs reference, new and unique_ptr, and the mistakes that crash programs.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>pointers</category><category>nullptr</category><category>references</category><category>std-unique-ptr</category><category>cpp17</category></item><item><title>Polymorphism in C++: one call, many behaviors</title><link>https://cpp-next.com/blog/polymorphism-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/polymorphism-in-cpp</guid><description>Polymorphism in C++ in plain words: one Shape example, virtual and override, compile-time vs runtime polymorphism in a table, and three common mistakes.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>polymorphism</category><category>virtual-functions</category><category>inheritance</category><category>templates</category><category>cpp17</category></item><item><title>printf in C++: format specifiers, std::string and snprintf</title><link>https://cpp-next.com/blog/printf-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/printf-in-cpp</guid><description>printf in C++ with examples: each format specifier and the type it expects, width and precision, printing a std::string, %zu and snprintf.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>printf</category><category>format-specifiers</category><category>std-snprintf</category><category>cpp17</category></item><item><title>C++ sqrt: square root with std::sqrt and cmath</title><link>https://cpp-next.com/blog/sqrt-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/sqrt-cpp</guid><description>C++ sqrt with std::sqrt from &lt;cmath&gt;: what it returns for an int, NaN for a negative number, a perfect-square check, pow(x, 0.5) and cube roots.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-sqrt</category><category>cmath</category><category>square-root</category><category>cpp17</category></item><item><title>std::accumulate in C++: sum a vector, with examples</title><link>https://cpp-next.com/blog/std-accumulate</link><guid isPermaLink="true">https://cpp-next.com/blog/std-accumulate</guid><description>std::accumulate in C++ sums a vector in one line. Learn why 0 gives the wrong total for doubles, how to pass a lambda, and when std::reduce fits.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-accumulate</category><category>std-reduce</category><category>algorithms</category><category>ranges</category><category>cpp17</category></item><item><title>std::array in C++: how to declare and use one</title><link>https://cpp-next.com/blog/std-array</link><guid isPermaLink="true">https://cpp-next.com/blog/std-array</guid><description>std::array in C++: declare and initialize one, get its size, check an index with at(), pass it to a function, and choose between it and std::vector.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-array</category><category>containers</category><category>bounds-checking</category><category>cpp17</category></item><item><title>std::atomic in C++: what it guarantees and when to use it</title><link>https://cpp-next.com/blog/std-atomic</link><guid isPermaLink="true">https://cpp-next.com/blog/std-atomic</guid><description>What std::atomic guarantees and what it does not: fetch_add, compare-exchange loops, bool flags, wait and notify, lock-free types, and when to use a mutex.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Concurrency</category><category>std-atomic</category><category>compare-exchange</category><category>memory-order</category><category>cpp20</category></item><item><title>C++ bitset: std::bitset explained with examples</title><link>https://cpp-next.com/blog/std-bitset</link><guid isPermaLink="true">https://cpp-next.com/blog/std-bitset</guid><description>C++ bitset with examples: build a std::bitset from a number or a string, set and test bits, count them, and turn it into a string, a number or binary.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-bitset</category><category>bit-manipulation</category><category>bitwise-operators</category><category>cpp17</category></item><item><title>Condition variable in C++: std::condition_variable explained</title><link>https://cpp-next.com/blog/std-condition-variable</link><guid isPermaLink="true">https://cpp-next.com/blog/std-condition-variable</guid><description>A condition variable in C++: std::condition_variable wait and notify, why wait takes a predicate, a producer-consumer queue, timeouts and stop_token.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Concurrency</category><category>std-condition-variable</category><category>std-mutex</category><category>producer-consumer</category><category>stop-token</category><category>cpp17</category></item><item><title>std::deque in C++: what it is and when to use it</title><link>https://cpp-next.com/blog/std-deque</link><guid isPermaLink="true">https://cpp-next.com/blog/std-deque</guid><description>std::deque in C++: push and pop at both ends, indexing, how it is stored, what a push invalidates, and deque vs vector and queue, with examples.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-deque</category><category>std-vector</category><category>std-queue</category><category>iterator-invalidation</category><category>cpp17</category></item><item><title>C++ std::find: search a vector, array or string</title><link>https://cpp-next.com/blog/std-find</link><guid isPermaLink="true">https://cpp-next.com/blog/std-find</guid><description>How std::find works in C++: search a vector, array or string, check the result against end(), get the index, use find_if, and call map::find instead.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-find</category><category>std-find-if</category><category>algorithms</category><category>ranges</category><category>cpp17</category></item><item><title>std::forward in C++: perfect forwarding explained</title><link>https://cpp-next.com/blog/std-forward</link><guid isPermaLink="true">https://cpp-next.com/blog/std-forward</guid><description>std::forward in C++ with one program that shows what it changes: forwarding references, std::forward vs std::move, parameter packs and the common mistakes.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Templates</category><category>std-forward</category><category>perfect-forwarding</category><category>forwarding-references</category><category>cpp17</category></item><item><title>C++ priority queue: std::priority_queue explained</title><link>https://cpp-next.com/blog/std-priority-queue</link><guid isPermaLink="true">https://cpp-next.com/blog/std-priority-queue</guid><description>How a C++ priority queue works: std::priority_queue push, top and pop, a min-heap, a comparator for a struct, the heap underneath and its limits.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-priority-queue</category><category>container-adaptors</category><category>heaps</category><category>comparators</category><category>cpp17</category></item><item><title>C++ set (std::set): sorted unique values explained</title><link>https://cpp-next.com/blog/std-set</link><guid isPermaLink="true">https://cpp-next.com/blog/std-set</guid><description>How a C++ set works: std::set insert and what it returns, find and contains, erase, looping, a set of your own type, and set vs multiset.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-set</category><category>std-multiset</category><category>std-unordered-set</category><category>containers</category><category>cpp17</category></item><item><title>C++ sort (std::sort): sort a vector or array</title><link>https://cpp-next.com/blog/std-sort</link><guid isPermaLink="true">https://cpp-next.com/blog/std-sort</guid><description>How to use std::sort in C++: sort a vector or array, in descending order, by a struct member, with ties kept in order, and the comparator mistake to avoid.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-sort</category><category>std-stable-sort</category><category>algorithms</category><category>cpp17</category></item><item><title>std::swap in C++: how to swap two values, with examples</title><link>https://cpp-next.com/blog/std-swap</link><guid isPermaLink="true">https://cpp-next.com/blog/std-swap</guid><description>std::swap in C++: the header, how to swap two numbers, two elements, two vectors or strings and your own class, and why a hand-written swap can do nothing.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-swap</category><category>move-semantics</category><category>std-vector</category><category>std-string</category><category>cpp17</category></item><item><title>std::tie, std::pair and std::tuple: unpacking and comparing</title><link>https://cpp-next.com/blog/std-tie-pair-and-tuple</link><guid isPermaLink="true">https://cpp-next.com/blog/std-tie-pair-and-tuple</guid><description>What std::tie does and what replaced it, how to make and read a std::pair or a std::tuple with std::get, what dangles, and when a struct is better.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-tie</category><category>std-pair</category><category>std-tuple</category><category>structured-bindings</category><category>cpp17</category></item><item><title>std::transform in C++: apply a function to every element</title><link>https://cpp-next.com/blog/std-transform</link><guid isPermaLink="true">https://cpp-next.com/blog/std-transform</guid><description>How std::transform works in C++: apply a function to every element, size the output or use back_inserter, uppercase a string, and the C++20 ranges forms.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-transform</category><category>algorithms</category><category>ranges</category><category>cpp17</category></item><item><title>Struct in C++: declare, initialize and use one</title><link>https://cpp-next.com/blog/struct-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/struct-in-cpp</guid><description>Struct in C++ explained: declare one, fill it with braces and default values, reach members with a dot or an arrow, pass it to functions, and struct vs class.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>struct</category><category>class</category><category>aggregate-initialization</category><category>cpp17</category></item><item><title>C++ substring: how to use substr(), with examples</title><link>https://cpp-next.com/blog/substring-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/substring-cpp</guid><description>How to get a substring in C++ with substr(): the first or last n characters, the text after a delimiter, the length trap, npos and contains.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-string</category><category>substr</category><category>string-view</category><category>cpp17</category></item><item><title>volatile keyword in C++: what it does and does not do</title><link>https://cpp-next.com/blog/volatile-in-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/volatile-in-cpp</guid><description>What the volatile keyword in C++ does: hardware registers, signal flags, why it is not thread-safe, const volatile and what C++20 deprecated.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>volatile</category><category>signals</category><category>std-atomic</category><category>cpp17</category></item><item><title>What does a compiler do? C++ source to program</title><link>https://cpp-next.com/blog/what-does-a-compiler-do</link><guid isPermaLink="true">https://cpp-next.com/blog/what-does-a-compiler-do</guid><description>What does a compiler do? It turns C++ source into a program in four stages, each run here on a real file, with the commands and the three kinds of error.</description><pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate><category>Tooling</category><category>compilers</category><category>linker</category><category>build-process</category><category>cpp17</category></item><item><title>Can a C++ destructor throw? What happens since C++11</title><link>https://cpp-next.com/blog/can-a-cpp-destructor-throw</link><guid isPermaLink="true">https://cpp-next.com/blog/can-a-cpp-destructor-throw</guid><description>Since C++11 a throwing destructor calls std::terminate. What noexcept(false) changes, why containers forbid it, and how to report failure from close().</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>destructors</category><category>exceptions</category><category>noexcept</category><category>raii</category><category>cpp20</category></item><item><title>clang-tidy: run it, configure it, pick the checks</title><link>https://cpp-next.com/blog/clang-tidy</link><guid isPermaLink="true">https://cpp-next.com/blog/clang-tidy</guid><description>clang-tidy from the first run to CI: one file, a whole project with compile_commands.json, a starter .clang-tidy and the checks to turn on first.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Tooling</category><category>clang-tidy</category><category>static-analysis</category><category>llvm</category><category>cpp17</category></item><item><title>Clang vs GCC: what differs for a C++ project</title><link>https://cpp-next.com/blog/clang-vs-gcc</link><guid isPermaLink="true">https://cpp-next.com/blog/clang-vs-gcc</guid><description>Clang vs GCC for C++: default standard, libstdc++ or libc++, C++26 features and warnings, each built on GCC 16.2 and Clang 23.1, then tools and which to pick.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Tooling</category><category>clang</category><category>gcc</category><category>llvm</category><category>compilers</category><category>cpp23</category></item><item><title>C++ expression templates explained with a C++20 example</title><link>https://cpp-next.com/blog/cpp-expression-templates</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-expression-templates</guid><description>Build a C++20 expression template that runs a + b + c in one loop with no temporaries, count what it removes, and see when Eigen or ranges fit better.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Templates</category><category>expression-templates</category><category>templates</category><category>concepts</category><category>operator-overloading</category><category>cpp20</category></item><item><title>C++ generators: co_yield and std::generator</title><link>https://cpp-next.com/blog/cpp-generators-co-yield-and-std-generator</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-generators-co-yield-and-std-generator</guid><description>Write a lazy sequence with co_yield: std::generator in C++23, a complete C++20 generator for libraries without it, and the lifetime rules that stop dangling.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Concurrency</category><category>coroutines</category><category>generators</category><category>std-generator</category><category>cpp23</category><category>ranges</category></item><item><title>C++ int to string: to_string, format or to_chars, not itoa</title><link>https://cpp-next.com/blog/cpp-int-to-string</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-int-to-string</guid><description>Convert an int to a string in C++ with std::to_string, std::format or std::to_chars: the exact output of each, what allocates, and why itoa is not standard.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-to-string</category><category>std-format</category><category>std-to-chars</category><category>cpp17</category></item><item><title>Strings as C++ template parameters with C++20 fixed_string</title><link>https://cpp-next.com/blog/cpp-string-as-template-parameter</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-string-as-template-parameter</guid><description>A string literal can’t be the argument of a pointer template parameter. How a C++20 fixed_string type fixes that, what came before, and what C++26 adds.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Templates</category><category>non-type-template-parameters</category><category>fixed-string</category><category>compile-time-strings</category><category>cpp20</category></item><item><title>C++ string to int: std::stoi or std::from_chars, not atoi</title><link>https://cpp-next.com/blog/cpp-string-to-int</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-string-to-int</guid><description>Convert a string to int in C++ with std::stoi or std::from_chars, reject trailing text, and see what each call, atoi included, does with bad input.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-from-chars</category><category>std-stoi</category><category>string-parsing</category><category>cpp17</category></item><item><title>C++ templates: how to write function and class templates</title><link>https://cpp-next.com/blog/cpp-templates</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-templates</guid><description>How to write C++ templates: function and class templates, how arguments are deduced, variadic packs and folds, and why the definition goes in a header.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Templates</category><category>templates</category><category>class-templates</category><category>variadic-templates</category><category>cpp17</category></item><item><title>C++ virtual functions: override, pure virtual and the traps</title><link>https://cpp-next.com/blog/cpp-virtual-function</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-virtual-function</guid><description>How a C++ virtual function call is resolved, why to write override and a virtual destructor, pure virtual functions, and which warnings catch the traps.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>virtual-functions</category><category>polymorphism</category><category>inheritance</category><category>cpp11</category></item><item><title>C++ vs C: what differs, what breaks, which to choose</title><link>https://cpp-next.com/blog/cpp-vs-c</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp-vs-c</guid><description>C++ vs C in compiled code: the valid C that four compilers reject as C++, how C23 moved toward C++, how extern “C” joins the two, and when to pick C.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Careers</category><category>c-language</category><category>c23</category><category>extern-c</category><category>cpp23</category></item><item><title>C++20 concepts: how to write and use them</title><link>https://cpp-next.com/blog/cpp20-concepts-how-to-write-and-use-them</link><guid isPermaLink="true">https://cpp-next.com/blog/cpp20-concepts-how-to-write-and-use-them</guid><description>Constrain C++20 templates with concepts: the four ways to write a constraint, requires expressions, the standard concepts, overloading, and what is not checked.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standards</category><category>concepts</category><category>constraints</category><category>templates</category><category>cpp20</category><category>sfinae</category></item><item><title>C++ generic lambdas, template lambdas and function objects</title><link>https://cpp-next.com/blog/generic-lambdas-and-function-objects</link><guid isPermaLink="true">https://cpp-next.com/blog/generic-lambdas-and-function-objects</guid><description>Write generic lambdas with auto (C++14) and template parameter lists (C++20), and know when a function template or a named function object is the better tool.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Templates</category><category>generic-lambdas</category><category>lambdas</category><category>function-objects</category><category>templates</category><category>cpp20</category></item><item><title>How to write comparators for std::sort and std::map</title><link>https://cpp-next.com/blog/how-to-write-comparators-for-std-sort-and-std-map</link><guid isPermaLink="true">https://cpp-next.com/blog/how-to-write-comparators-for-std-sort-and-std-map</guid><description>std::sort, std::set and std::map need a strict weak ordering: the three rules, what breaks when one fails, and the comparison C++20’s &lt;=&gt; writes for you.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>comparators</category><category>strict-weak-ordering</category><category>three-way-comparison</category><category>cpp20</category></item><item><title>Java vs C++: what differs in the code, and which to choose</title><link>https://cpp-next.com/blog/java-vs-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/java-vs-cpp</guid><description>Java vs C++ in code built and run in both: what =, == and new do, what an overflow, a bad index or a null costs, generics, speed and which to pick.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Careers</category><category>java</category><category>undefined-behavior</category><category>raii</category><category>cpp23</category></item><item><title>C++ move semantics: what std::move and &amp;&amp; really do</title><link>https://cpp-next.com/blog/move-semantics-std-move-and-rvalue-references</link><guid isPermaLink="true">https://cpp-next.com/blog/move-semantics-std-move-and-rvalue-references</guid><description>What a move is, why std::move moves nothing, what C++17, C++20 and C++23 changed about temporaries and returns, and four move mistakes clang-tidy catches.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>move-semantics</category><category>rvalue-references</category><category>std-move</category><category>perfect-forwarding</category><category>cpp20</category></item><item><title>C++ pass by value or const reference: the rule since C++17</title><link>https://cpp-next.com/blog/pass-by-value-or-const-reference</link><guid isPermaLink="true">https://cpp-next.com/blog/pass-by-value-or-const-reference</guid><description>By value, const reference, &amp;&amp; or a view? Choose each C++ parameter by what the function does with it, with the C++17 rules and a program that counts copies.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category><category>parameter-passing</category><category>copy-elision</category><category>move-semantics</category><category>string-view</category><category>cpp20</category></item><item><title>Rule of zero: the special members C++ writes for you</title><link>https://cpp-next.com/blog/rule-of-zero-and-special-member-functions</link><guid isPermaLink="true">https://cpp-next.com/blog/rule-of-zero-and-special-member-functions</guid><description>Which special member functions C++ declares for a class, what declaring one does to the others, and when to write none, all five, or delete them.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>rule-of-zero</category><category>special-member-functions</category><category>move-semantics</category><category>cpp20</category></item><item><title>std::expected in C++23: return a value or an error</title><link>https://cpp-next.com/blog/std-expected</link><guid isPermaLink="true">https://cpp-next.com/blog/std-expected</guid><description>Return a value or an error with std::expected (C++23): std::unexpected, what each accessor does in the wrong state, chaining, choosing E, and when to use it.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-expected</category><category>std-optional</category><category>error-handling</category><category>cpp23</category></item><item><title>std::function in C++: what it costs, what to use instead</title><link>https://cpp-next.com/blog/std-function</link><guid isPermaLink="true">https://cpp-next.com/blog/std-function</guid><description>What std::function stores, its size and allocations measured on three standard libraries, and when a template, a function pointer or a newer wrapper fits.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Templates</category><category>std-function</category><category>function-pointers</category><category>lambdas</category><category>type-erasure</category><category>cpp17</category></item><item><title>C++ map: std::map find, insert, erase and iterate</title><link>https://cpp-next.com/blog/std-map</link><guid isPermaLink="true">https://cpp-next.com/blog/std-map</guid><description>Use a C++ map: look a key up with find, contains or at, add one with try_emplace, erase in a loop, and see what std::map does when a key is missing.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-map</category><category>std-unordered-map</category><category>std-flat-map</category><category>cpp17</category></item><item><title>std::mutex in C++: how to lock it, and which lock to use</title><link>https://cpp-next.com/blog/std-mutex</link><guid isPermaLink="true">https://cpp-next.com/blog/std-mutex</guid><description>Lock a std::mutex with std::scoped_lock: which lock fits which job, why two mutexes deadlock, the unnamed lock that locks nothing, and how big each mutex is.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Concurrency</category><category>std-mutex</category><category>scoped-lock</category><category>deadlock</category><category>cpp17</category></item><item><title>std::optional in C++: how to use it and when not to</title><link>https://cpp-next.com/blog/std-optional</link><guid isPermaLink="true">https://cpp-next.com/blog/std-optional</guid><description>Create, test, read, empty and refill a std::optional, what each accessor does when it is empty, what it costs, and when std::expected fits better.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-optional</category><category>std-expected</category><category>error-handling</category><category>cpp17</category></item><item><title>std::println in C++23: print without std::cout or printf</title><link>https://cpp-next.com/blog/std-println</link><guid isPermaLink="true">https://cpp-next.com/blog/std-println</guid><description>std::println in C++23: the syntax, each std::cout and printf line translated, what a bad format string does, whether it flushes, and std::endl vs newline.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-println</category><category>std-cout</category><category>std-endl</category><category>std-format</category><category>cpp23</category></item><item><title>std::span in C++20: pass a view, not a pointer and a size</title><link>https://cpp-next.com/blog/std-span</link><guid isPermaLink="true">https://cpp-next.com/blog/std-span</guid><description>Take std::span by value: what converts to it, slicing with subspan, what s[i] out of range does on each library, and how a span dangles.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-span</category><category>parameter-passing</category><category>bounds-checking</category><category>cpp20</category></item><item><title>std::thread and std::jthread: start, join and stop a thread</title><link>https://cpp-next.com/blog/std-thread-and-jthread</link><guid isPermaLink="true">https://cpp-next.com/blog/std-thread-and-jthread</guid><description>Start a thread with std::thread or std::jthread (C++20): pass arguments with std::ref, get a result, stop it with a stop_token, and what a missed join prints.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Concurrency</category><category>std-thread</category><category>std-jthread</category><category>stop-token</category><category>cpp20</category></item><item><title>std::variant in C++: std::visit, std::get and the traps</title><link>https://cpp-next.com/blog/std-variant</link><guid isPermaLink="true">https://cpp-next.com/blog/std-variant</guid><description>Create a std::variant, read it with std::get, get_if or std::visit, catch the missing case a conversion hides, and see what it costs and when to skip it.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Standard Library</category><category>std-variant</category><category>std-visit</category><category>std-monostate</category><category>cpp17</category></item><item><title>std::vector in C++: size, capacity, erase and reallocation</title><link>https://cpp-next.com/blog/std-vector</link><guid isPermaLink="true">https://cpp-next.com/blog/std-vector</guid><description>std::vector size against capacity, how each standard library grows it, what every member invalidates, and erase, find and sort, checked on four compilers.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category><category>std-vector</category><category>iterator-invalidation</category><category>move-semantics</category><category>cpp17</category></item><item><title>C++ try catch: how to throw and catch exceptions</title><link>https://cpp-next.com/blog/try-catch-cpp</link><guid isPermaLink="true">https://cpp-next.com/blog/try-catch-cpp</guid><description>C++ try, catch and throw: the syntax, why you catch by const reference, the order of handlers, your own exception type, and what happens when nothing catches.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>exceptions</category><category>error-handling</category><category>noexcept</category><category>cpp17</category></item><item><title>using namespace std: what it does and what to write instead</title><link>https://cpp-next.com/blog/using-namespace-std</link><guid isPermaLink="true">https://cpp-next.com/blog/using-namespace-std</guid><description>What using namespace std does to name lookup, the clashes and silent overload changes it caused on four compilers, and what to write instead.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Language</category><category>using-namespace-std</category><category>namespaces</category><category>name-lookup</category><category>cpp17</category></item><item><title>When to mark a move constructor noexcept in C++</title><link>https://cpp-next.com/blog/when-to-mark-a-move-constructor-noexcept</link><guid isPermaLink="true">https://cpp-next.com/blog/when-to-mark-a-move-constructor-noexcept</guid><description>Mark moves and swap noexcept when they cannot throw, or std::vector copies where it could move. What is noexcept already, and how to check it at compile time.</description><pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category><category>noexcept</category><category>move-semantics</category><category>std-vector</category><category>exception-safety</category><category>cpp20</category></item></channel></rss>