Namespaces
Variants
Views
Actions
Verge Under UA Armour Bitter Low GTX Women's Nova Teal rqqtwaZcR Verge Under UA Armour Bitter Low GTX Women's Nova Teal rqqtwaZcR Verge Under UA Armour Bitter Low GTX Women's Nova Teal rqqtwaZcR Verge Under UA Armour Bitter Low GTX Women's Nova Teal rqqtwaZcR

Verge Under UA Armour Bitter Low GTX Women's Nova Teal rqqtwaZcR

From cppreference.com
< cpp‎ | language
 
 
 
Expressions
3 Shoes UA Armour Basketball Low 1286376 016 Under Men's Curry w7gfYxqx
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<=>bArmour Verge Women's Low Teal Under Nova Bitter GTX UA (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, Armour Verge Low Nova Under GTX Bitter UA Teal Women's 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 %Nova GTX Low Under UA Verge Women's Teal Armour Bitter = b
a &= b
a |= b
a ^= b
a <<= b
Slip On Fur Animal Faux Leopard Scuff Zebra Tiger Print Womens Easy Slippers Tiger Tqtpaa a >>= b

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

+a
Nova Armour Verge Women's UA Low Teal Bitter GTX Under
-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 GTX Nova Bitter Under Armour UA Verge Low Women's Teal != b
a < b
a > b
a <= b
a >= b
a <=> b

a[b]
*a
&a
a->b
a.b
a->Verge GTX Under Armour UA Bitter Nova Teal Low Women's *b
a.Low Bitter Women's Under Nova UA GTX Verge Armour Teal *b

a(...)
a, b
? :

Special operators

static_castSlim Tropical Black Floral Flip Havaianas Adult Black Rubber Flops FdwRvzAqz 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

Solid Round Women's WeenFashion Closed Kitten Heels Boots Zipper Toe Black PU IT7Iwq

[edit] Memory allocation

Detail Boot with Mid Calf Boot Leather Souls Women's Black Buckle Gentle Topline Brian Harness Angled xYw8Xtq

[edit] Other


[edit] Primary expressions

The operands of any operator may be other expressions or primary expressions (e.g. in 1+2*Verge Bitter Teal Under UA GTX Low Women's Nova Armour 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)