Modified ECMAScript regular expression grammar

This page describes the regular expression grammar that is used when std::basic_regex is constructed with syntax_option_type set to ECMAScript (the default). See syntax_option_type for the other supported regular expression grammars. The ECMAScript regular expression grammar in C++ is ECMA-262 grammar with modifications marked with (C++ only) below. Alternatives A regular expression pattern is sequence of one or more Alternatives, separated by the disjunction operator | (in other words, th

Memory model

Defines the semantics of computer memory storage for the purpose of the C++ abstract machine. The memory available to a C++ program is one or more contiguous sequences of bytes. Each byte in memory has a unique address'. Byte A byte is the smallest addressable unit of memory. It is defined as a contiguous sequence of bits, large enough to hold the value of any UTF-8 code unit (256 distinct values) and of (since C++14)any member of the basic execution character set (the 96 characters that ar

memory

This header is part of the dynamic memory management library. Classes Smart pointers categories unique_ptr (C++11) smart pointer with unique object ownership semantics (class template) shared_ptr (C++11) smart pointer with shared object ownership semantics (class template) weak_ptr (C++11) weak reference to an object managed by std::shared_ptr (class template) auto_ptr (until C++17) smart pointer with strict object ownership semantics (class template) Sma

Member templates

Template declarations (class, function, and variables (since C++14)) can appear inside a member specification of any class, struct, or union that aren't local classes. #include <iostream> #include <vector> #include <algorithm> struct Printer { // generic functor std::ostream& os; Printer(std::ostream& os) : os(os) {} template<typename T> void operator()(const T& obj) { os << obj << ' '; } // member template }; int main() {

Member access operators

Accesses a member of its operand. Operator name Syntax Over​load​able Prototype examples (for class T) Inside class definition Outside class definition subscript a[b] Yes R& T::operator[](S b); N/A indirection *a Yes R& T::operator*(); R& operator*(T a); address-of &a Yes R* T::operator&(); R* operator&(T a); member of object a.b No N/A N/A member of pointer a->b Yes R* T::operator->(); N/A pointer to membe

MATH_ERRNO

Defined in header <cmath> #define MATH_ERRNO 1 (since C++11) #define MATH_ERREXCEPT 2 (since C++11) #define math_errhandling /*implementation defined*/ (since C++11) The macro constant math_errhandling expands to an expression of type int that is either equal to MATH_ERRNO, or equal to MATH_ERREXCEPT, or equal to their bitwise OR (MATH_ERRNO | MATH_ERREXCEPT). The value of math_errhandling indicates the type of error handling that is performed by the

map

This header is part of the containers library. Classes map collection of key-value pairs, sorted by keys, keys are unique (class template) multimap collection of key-value pairs, sorted by keys (class template) Functions operator==operator!=operator<operator<=operator>operator>= lexicographically compares the values in the map (function template) std::swap(std::map) specializes the std::swap algorithm (function template) operator==operator!=operator<

Main function

A program shall contain a global function named main, which is the designated start of the program. int main () { body } (1) int main (int argc, char *argv[]) { body } (2) int main (int argc, char *argv[] , other_parameters ) { body } (3) argc - Non-negative value representing the number of arguments passed to the program from the environment in which the program is run. argv - Pointer to the first element of an array of pointers to null-terminated multibyte st

Low level memory management

The new-expression is the only way to create an object or an array of objects with dynamic storage duration, that is, with lifetime not restricted to the scope in which it is created. A new-expression obtains storage by calling an allocation function. A delete-expression destroys a most derived object or an array created by a new-expression and calls the deallocation function. The default allocation and deallocation functions, along with related functions, types, and objects, are declared in th

long

Usage long type modifier