C++The > operator tests whether the left operand is greater than the right. A built-in comparison returns bool; equal values produce false. Learn about numeric conversions, chained-comparison pitfalls, and the distinction between built-in and overloaded comparisons.
Basic · C++23; repository compiler flag, production runtime not attestedC++The ++ operator increments its operand. For built-in types, ++x provides the modified object, whereas x++ produces a copy of the previous value. Learn the operand requirements, the distinction between the two forms, and their basic restrictions.
Basic · C++23; repository compiler flag, production runtime not attestedC++The != operator tests whether its operands are unequal. The built-in operation returns bool after required conversions. Classes can define operator!= or use an eligible operator== through comparison rewriting rules.
Basic · C++23; repository compiler flag, production runtime not attestedC++The built-in << operator shifts an integer value's bits left, filling vacated positions with zeros. The shift count must be within the width of the promoted left operand. Do not confuse it with stream insertion.
Basic · C++23; repository compiler flag, production runtime not attestedC++The <<= operator shifts the left operand's bits to the left and stores the result in the same object. The left operand is evaluated only once, and the valid shift-count range depends on its type after integral promotion.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++The <= operator checks whether its left operand is less than or equal to its right operand. The built-in version returns bool. It is useful for inclusive limits; take care with type conversions and chained comparisons.
Basic · C++23; repository compiler flag, production runtime not attestedC++The < operator tests whether its left operand is less than its right operand. A built-in comparison returns bool and excludes equality. Watch for type conversions, restrictions on pointer comparisons, and the misleading chained expression a < b < c.
Basic · C++23; repository compiler flag, production runtime not attestedC++The built-in && operator produces true only when both conditions are true. It evaluates the left operand first and skips the right operand when the left is false; this is short-circuit evaluation.
Basic · C++23; repository compiler flag, production runtime not attestedC++The unary operator ! reverses its operand's truth value. The built-in operator contextually converts the operand to bool and returns bool: true for a false value and false for a true value.
Basic · C++23; repository compiler flag, production runtime not attestedC++The built-in || operator returns bool: true when at least one operand is true, and false otherwise. It short-circuits: when the left operand is true, the right operand is not evaluated.
Basic · C++23; repository compiler flag, production runtime not attestedC++The . operator accesses a member of a class, struct, or union object. It lets you read and modify data members and call member functions. It also works through an object reference, but does not replace -> for a pointer.
Basic · C++23; repository compiler flag, production runtime not attestedC++The *= operator multiplies the left operand’s current value by the right operand and stores the result back. The left operand is evaluated only once, and converting the result to its type can discard a fractional part.
Basic · C++23; repository compiler flag, production runtime not attestedC++The binary * operator calculates the product of two values. The result type depends on the operand types and the usual arithmetic conversions, not on the destination variable's type. Learn multiplication precedence and the pitfalls of overflow.
Basic · C++23; repository compiler flag, production runtime not attestedC++A new-expression creates an object and returns a pointer to it; it usually also obtains storage. Distinguish it from the allocation function operator new, and learn about array new[] and the Placement new-expression that constructs an object in supplied storage.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++The -> operator accesses a data member or calls a member function of the object a pointer points to. For the built-in operator, pointer->member is equivalent to (*pointer).member.
Basic · C++23; repository compiler flag, production runtime not attestedC++A pointer to member identifies a class member, not a particular object's member. Form it with &T::member, then apply it to an object with .* or to an object pointer with ->*.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++The built-in ->* operator combines an object pointer with a pointer to a class member. It lets you read or modify a data member, or call a member function selected by that member pointer.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++Operator | either applies an adaptor closure to a range or composes two closures into a pipeline. Distinguish R | C, which invokes the adaptor, from C | D, which creates an operation for later use.
Intermediate · C++23; repository compiler flag, production runtime not attestedC++reinterpret_cast performs selected low-level conversions, primarily involving pointers and references. The cast itself does not authorize access through an incompatible type: aliasing, alignment, and object-lifetime rules still apply.
Advanced · C++23; repository compiler flag, production runtime not attestedC++The built-in % operator computes the remainder of integer division. It is not a percentage operator or a guarantee of nonnegative modulo: a nonzero remainder has the sign of the dividend after type conversions. A zero divisor or an unrepresentable quotient causes undefined behavior.
Basic · C++23; repository compiler flag, production runtime not attestedC++The %= operator calculates a remainder and stores it in its left operand. The left side is evaluated only once. The built-in operator requires a modifiable integral object; a zero divisor causes undefined behavior.
Basic · C++23; repository compiler flag, production runtime not attestedC++The built-in >> operator shifts an integer's bits to the right. In C++23, its result corresponds to division by a power of two, rounded toward negative infinity. The number of positions shifted must be within the permitted range.
Basic · C++23; repository compiler flag, production runtime not attestedC++The >>= operator shifts the left operand's bits to the right and stores the result in the same object. The left operand is evaluated only once. Validity depends on the shift count and the type after integral promotion.
Basic · C++23; repository compiler flag, production runtime not attestedC++The :: operator qualifies a name by specifying the namespace, class, or enumeration in which it is looked up. A leading :: denotes the global namespace. It helps distinguish hidden names and define member functions outside the class definition.
Basic · C++23; repository compiler flag, production runtime not attested