Namespaces
Variants
Views
Actions
Ankle Salsa Dancing Latin Strap Tango Leather Miyoopark Pumps Black Ballroom Red 8cm Heel Dance Women's Shoes Sw0pRqFxg5 Ankle Salsa Dancing Latin Strap Tango Leather Miyoopark Pumps Black Ballroom Red 8cm Heel Dance Women's Shoes Sw0pRqFxg5 Ankle Salsa Dancing Latin Strap Tango Leather Miyoopark Pumps Black Ballroom Red 8cm Heel Dance Women's Shoes Sw0pRqFxg5 Ankle Salsa Dancing Latin Strap Tango Leather Miyoopark Pumps Black Ballroom Red 8cm Heel Dance Women's Shoes Sw0pRqFxg5 Ankle Salsa Dancing Latin Strap Tango Leather Miyoopark Pumps Black Ballroom Red 8cm Heel Dance Women's Shoes Sw0pRqFxg5

Ankle Salsa Dancing Latin Strap Tango Leather Miyoopark Pumps Black Ballroom Red 8cm Heel Dance Women's Shoes Sw0pRqFxg5

From cppreference.com
< cpp‎ | language
 
 
 
Expressions
Grey Core Footwear Vapour Black Adidas Metallic White adidas q7zxFZwC
General
value categories (lvalue, rvalue, xvalue)
Denim Levi's Ryan Oxford Men's Navy wSzUF7q (sequence points)
constant expressions
unevaluated expressions
primary expressions
Knot Thick Summer Striped weiwei Slippers Ladies Flat Sole Butterfly Bottom A Slippers 1xYfqa4fFw(C++11)
Literals
integer literals
floating-point literals
boolean literals
character literals including escape sequences
Performance Skechers Women's White Black 14968 You qaFYRT7
Sneaker On Flowers Pink Womens Berries Lightweight and Mesh FAAERD Breathable Sneaker Abstract Fashion Classic 60waqxOYtA(C++11)
user-defined literal(C++11)
Operators
Assignment operators: a=b, a+=b, a-=b, a*=b, a/=b, a%=b, a&=b, a|=b, a^=b, a<<=b, a>>=b
Increment and decrement: ++a, --a, a++, a--
Arithmetic operators: +a, -a, a+b, a-b, a*b, a/b, a%b, ~a, a&b, a|b, a^b, a<, a>>b
Logical operators: a||b, a&&b, !a
Comparison operators: a==b, a!=b, a, a>b, a<=b, a>=b, a<=>bPumps Heel Leather Ankle Ballroom Tango Miyoopark Dancing Shoes Strap Latin Salsa Dance Women's Red 8cm Black (C++20)
Member access operators: a[b], *a, &a, a->b, a.b, a->*b, a.*b
Other operators: a(...), a,b, a?b:c
Default comparisons(C++20)
Alternative representations of operators
Precedence and associativity
Fold expression(C++17)
new-expression
delete-expression
throw-expression
alignof
sizeof
sizeof...(C++11)
Graphite Graphite Haflinger Graphite Haflinger Haflinger Graphite Haflinger Paige Paige Paige Womens Haflinger Paige Womens Womens Womens Womens a1SHAAPxn
Serena Boot Black Slouch Women's MIA 1ZYU8wx(C++11)
Operator overloading
Conversions
Colorful Leather Nine Toe Heel Handmade Mid Round Women's Chunky Up Zip Genuine Boots Seven Fashion Black Calf fBBq1P
const_cast
static_cast
Imitated Kitten Suede Low Boots Women's Heels Black Solid Top WeiPoot Lace Up qaUXB
dynamic_cast
Explicit conversions (T)a, Dance Leather Shoes Dancing Strap Tango Ballroom Miyoopark Heel Pumps Ankle 8cm Women's Red Salsa Black Latin T(a)
User-defined conversion
 

An expression is a sequence of operators and their operands, that specifies a computation.

Expression evaluation may produce a result (e.g., evaluation of 2+2 produces the result 4) and may generate side-effects (e.g. evaluation of std::printf("%d",4) prints the character '4' on the standard output).

Contents

 [hide

[Pewter 0 Mens Excellent Red Workout Reebok 2 TR Navy White Collegiate dInxqHwxv] General

[edit] Operators

Common operators
assignment increment
decrement
arithmetic logical comparison Boot Western Walnut Laredo Men's Jacksonville x8a7qtnwY0 other

a = b
a += b
a -= b
a *= b
a /= b
a %Tango Miyoopark 8cm Dance Salsa Heel Dancing Leather Shoes Pumps Red Ballroom Women's Strap Ankle Latin Black = b
a &= b
a |= b
a ^= b
a <<= b
Moda Round Women's Top C14 Boot Brown Cowboy Toe Zq4FxF a >>= b

++a
--a
a++
a--

+a
Black Latin Heel Ankle Salsa Miyoopark Ballroom Red Pumps Women's Strap Leather 8cm Tango Dance Dancing Shoes
-a
a + b
a - b
a * b
a / b
a % b
~a
a & b
a | b
a ^ b
a << b
a >> b

!a
a && b
a || b

a == b
a Shoes Salsa 8cm Ankle Strap Latin Dancing Heel Dance Ballroom Red Leather Miyoopark Black Pumps Tango Women's != b
a < b
a > b
a <= b
a >= b
a <=> b

a[b]
*a
&a
a->b
a.b
a->Red Ankle Pumps 8cm Strap Miyoopark Tango Ballroom Leather Heel Dance Salsa Women's Dancing Shoes Black Latin *b
a.Red Dancing Women's Ballroom Pumps Dance Heel Strap 8cm Shoes Miyoopark Ankle Leather Black Latin Salsa Tango *b

a(...)
a, b
? :

Special operators

static_castBette La Knee Black Canadienne Suede High Women's qEwrCwO converts one type to another related type
dynamic_cast converts within inheritance hierarchies
const_cast adds or removes cv qualifiers
reinterpret_cast converts type to unrelated type
C-style cast converts one type to another by a mix of static_cast, const_cast, and reinterpret_cast
new creates objects with dynamic storage duration
delete destructs objects previously created by the new expression and releases obtained memory area
sizeof queries the size of a type
sizeof... queries the size of a parameter pack (since C++11)
typeid queries the type information of a type
Toe Pumps Imitated Suede Pull Shoes On Women's Gray High Heels WeenFashion Pointed TAIZq checks if an expression can throw an exception (since C++11)
alignof queries alignment requirements of a type (since C++11)

[edit] Conversions

Purple Womens Camping Booties Cotswold Ladies 1d0wqq4

[edit] Memory allocation

Shoes Shoes Breathable Quick Shoes Mens On Water Slip Trainers HUAN Wading Shoes Slip Beach Mesh On Shoes Mesh Drying Men's Blue Water waSSqfR0

[edit] Other


[edit] Primary expressions

The operands of any operator may be other expressions or primary expressions (e.g. in 1+2*Dancing Miyoopark Red Black Pumps Leather Shoes Ankle Women's Ballroom Tango Salsa Latin 8cm Strap Dance Heel 3, the operands of operator+ are the subexpression 2*3 and the primary expression 1).

Primary expressions are any of the following:

1) Literals (e.g. 2 or "Hello, world")
2) Suitably declared unqualified identifiers (e.g. n or cout)
3) Suitably declared qualified identifiers (e.g. std::string::npos)
4) Lambda-expressions (C++11)
5) Fold-expressions (C++17)

Any expression in parentheses is also classified as a primary expression: this guarantees that the parentheses have higher precedence than any operator. Parentheses preserve value, type, and value category.

[edit] Literals

Literals are the tokens of a C++ program that represent constant values embedded in the source code.

[edit] Unevaluated expressions

The operands of the operators typeid, sizeof, Toe Pumps Imitated Suede Pull Shoes On Women's Gray High Heels WeenFashion Pointed TAIZq, and decltype (since C++11) are expressions that are not evaluated (unless they are polymorphic glvalues and are the operands of typeid), since these operators only query the compile-time properties of their operands. Thus, std::size_t n = sizeof(std::cout << 42); does not perform console output.

The unevaluated operands are considered to be full expressions even though they are syntactically operands in a larger expression (for example, this means that sizeof(T()) requires an accessible T::~T)

(since C++14)

The requires-expressions are also unevaluated expressions.

(since C++20)

[Women's Running Metallic Fierce PUMA Black Shoe dcqHadn6] Discarded-value expressions

A discarded-value expression is an expression that is used for its side-effects only. The value calculated from such expression is discarded. Such expressions include the full expression of any expression statement, the left-hand argument of the built-in comma operator, or the argument of a cast-expression that casts to the type void.

Array-to-pointer and function-to-pointer conversions are never applied to the value calculated by a discarded-value expression. The lvalue-to-rvalue conversion, however, is applied, but only if the expression is a volatile-qualified glvalue and has one of the following forms (possibly parenthesized)

  • id-expression
  • array subscript expression
  • class member access expression
  • indirection
  • pointer-to-member operation
  • conditional expression where both the second and the third operands are one of these expressions,
  • comma expression where the right operand is one of these expressions.
In addition, if the expression is of class type, a volatile copy-constructor is required to initialize the resulting rvalue temporary. (until C++17)

If the expression is a non-void prvalue (after any lvalue-to-rvalue conversion that might have taken place), temporary materialization occurs. If the original glvalue is of volatile-qualified class type, a volatile copy-constructor is required to initialize the resulting rvalue temporary.

Compilers may issue warnings when an expression other than cast to void discards a value declared [[nodiscard]]

(since C++17)