Miriam Castellanos
Editor and senior C++ engineer
- Answers
- 96
- Writes
- Language, Standard Library, Templates, Performance, Concurrency, Standards
- Reply-to
- hello@
cpp-next.com

Miriam Castellanos has written C++ for a living for sixteen years, most of them on a large simulation codebase that she helped move from C++03 to C++11, then to C++17 and C++20, one compiler upgrade at a time. She keeps a running list of the advice she had to unlearn on the way, and many of the guides here start from it.
As editor she writes the Language, Standard Library, Templates, Performance, Concurrency and Standards sections, edits every guide, and checks each code sample under the standard it names.
§
Answers 96, newest first
- 1
std::vectorExplained: How the Dynamic Array WorksLanguage · - 2Function Type Explained: Signatures Without the BodyTemplates ·
- 3assert in C++: how assert and
static_assertworkLanguage · · C++17 - 4Binary search in C++: code and
std::binary_searchStandard Library · · C++17 - 5bool in C++: true, false and how to use themLanguage · · C++17
- 6cin in C++: read numbers, words and linesStandard Library · · C++17
- 7const in C++: variables, pointers, references, methodsLanguage · · C++17
- 8constexpr in C++: variables, functions and static constexprLanguage · · C++17
- 9C++ array: declare, initialize and get the lengthLanguage · · C++17
- 10C++ class: how to define one and create objectsLanguage · · C++17
- 11C++ constructor: default, parameterized, copy and moveLanguage · · C++11
- 12continue in C++: skip to the next loop iterationLanguage · · C++17
- 13C++ cout: how to print with
std::coutStandard Library · · C++17 - 14C++ data structures: which container to useStandard Library · · C++17
- 15Data types in C++: int, double, char, bool and moreLanguage · · C++17
- 16C++ do while loop: syntax, examples and do while vs whileLanguage · · C++17
- 17C++ enum and enum class: declare, convert, switchLanguage · · C++11
- 18C++ friend class and friend function: syntax and rulesLanguage · · C++17
- 19C++ function pointer: syntax, callbacks and examplesLanguage · · C++17
- 20C++ functions: syntax, calling and overloadingLanguage · · C++17
- 21C++ getline: how to read a whole line of inputStandard Library · · C++11
- 22C++ ifstream: how to open and read a fileStandard Library · · C++17
- 23Inheritance in C++: base and derived classesLanguage · · C++17
- 24C++ initializer list: member lists and
std::Language · · C++17initializer_list - 25C++ iterator: how
begin()andend()workStandard Library · · C++17 - 26C++ linked list: write one, then use
std::listStandard Library · · C++17 - 27C++ main function: int
main(), argc and argvLanguage · · C++17 - 28memcpy in C++: how
std::memcpyworks and when to use itPerformance · · C++17 - 29C++ namespace: declare, nest, alias and reopenLanguage · · C++17
- 30C++ OOPs concepts: the four ideas, with codeLanguage · · C++17
- 31C++ operator overloading: signatures, member or friendLanguage · · C++20
- 32C++ operator precedence: table, rules and pitfallsLanguage · · C++17
- 33C++ operators: the full list with examplesLanguage · · C++17
- 34C++ pair: what
std::pairis and how to use itStandard Library · · C++17 - 35C++ queue: how
std::queueworks, with examplesStandard Library · · C++11 - 36C++ random number: how to generate one in a rangeStandard Library · · C++11
- 37C++ split string: 3 ways with code (getline, find, views)Standard Library · · C++17
- 38Stack in C++: how
std::stackworks, with examplesStandard Library · · C++17 - 39C++ string (
std::string) explained with examplesStandard Library · · C++17 - 40C++ string comparison: ==,
compare()and strcmpStandard Library · · C++17 - 41C++ string concatenation: +, += and
append()Standard Library · · C++17 - 42C++ string find: how to find a substring and check nposStandard Library · · C++17
- 43C++ string length:
size(),length()and strlenStandard Library · · C++17 - 44C++ struct vs class: the only two differencesLanguage · · C++17
- 45C++ ternary operator (?:): syntax and examplesLanguage · · C++17
- 46C++ typedef: what it does and when to write using insteadLanguage · · C++17
- 47C++ while loop (and do-while): syntax and examplesLanguage · · C++17
- 48Destructor in C++: what it is and when it runsLanguage · · C++17
- 49Pointers in C++: what they are and how they workLanguage · · C++17
- 50Polymorphism in C++: one call, many behaviorsLanguage · · C++17
- 51printf in C++: format specifiers,
std::stringand snprintfStandard Library · · C++17 - 52C++ sqrt: square root with
std::sqrtand cmathStandard Library · · C++17 - 53
std::accumulatein C++: sum a vector, with examplesStandard Library · · C++17 - 54
std::arrayin C++: how to declare and use oneStandard Library · · C++17 - 55
std::atomicin C++: what it guarantees and when to use itConcurrency · · C++20 - 56C++ bitset:
std::bitsetexplained with examplesStandard Library · · C++17 - 57Condition variable in C++:
std::explainedConcurrency · · C++17condition_variable - 58
std::dequein C++: what it is and when to use itStandard Library · · C++17 - 59C++
std::find: search a vector, array or stringStandard Library · · C++17 - 60
std::forwardin C++: perfect forwarding explainedTemplates · · C++17 - 61C++ priority queue:
std::priority_queueexplainedStandard Library · · C++17 - 62C++ set (
std::set): sorted unique values explainedStandard Library · · C++17 - 63C++ sort (
std::sort): sort a vector or arrayStandard Library · · C++17 - 64
std::swapin C++: how to swap two values, with examplesStandard Library · · C++17 - 65
std::tie,std::pairandstd::tuple: unpacking and comparingStandard Library · · C++17 - 66
std::transformin C++: apply a function to every elementStandard Library · · C++17 - 67Struct in C++: declare, initialize and use oneLanguage · · C++17
- 68C++ substring: how to use
substr(), with examplesStandard Library · · C++17 - 69volatile keyword in C++: what it does and does not doLanguage · · C++17
- 70Can a C++ destructor throw? What happens since C++11Language · · C++20
- 71C++ expression templates explained with a C++20 exampleTemplates · · C++20
- 72C++ generators:
co_yieldandstd::generatorConcurrency · · C++23 - 73C++ int to string:
to_string, format orto_chars, not itoaStandard Library · · C++17 - 74Strings as C++ template parameters with C++20
fixed_stringTemplates · · C++20 - 75C++ string to int:
std::stoiorstd::from_chars, not atoiStandard Library · · C++17 - 76C++ templates: how to write function and class templatesTemplates · · C++17
- 77C++ virtual functions: override, pure virtual and the trapsLanguage · · C++11
- 78C++20 concepts: how to write and use themStandards · · C++20
- 79C++ generic lambdas, template lambdas and function objectsTemplates · · C++20
- 80How to write comparators for
std::sortandstd::mapStandard Library · · C++20 - 81C++ move semantics: what
std::moveand&&really doLanguage · · C++20 - 82C++ pass by value or const reference: the rule since C++17Performance · · C++20
- 83Rule of zero: the special members C++ writes for youLanguage · · C++20
- 84
std::expectedin C++23: return a value or an errorStandard Library · · C++23 - 85
std::functionin C++: what it costs, what to use insteadTemplates · · C++17 - 86C++ map:
std::mapfind, insert, erase and iterateStandard Library · · C++17 - 87
std::mutexin C++: how to lock it, and which lock to useConcurrency · · C++17 - 88
std::optionalin C++: how to use it and when not toStandard Library · · C++17 - 89
std::printlnin C++23: print withoutstd::coutor printfStandard Library · · C++23 - 90
std::spanin C++20: pass a view, not a pointer and a sizeStandard Library · · C++20 - 91
std::threadandstd::jthread: start, join and stop a threadConcurrency · · C++20 - 92
std::variantin C++:std::visit,std::getand the trapsStandard Library · · C++17 - 93
std::vectorin C++: size, capacity, erase and reallocationPerformance · · C++17 - 94C++ try catch: how to throw and catch exceptionsLanguage · · C++17
- 95using namespace std: what it does and what to write insteadLanguage · · C++17
- 96When to mark a move constructor noexcept in C++Performance · · C++20