Compilation time statements

Can someone provide a list of all compile-time operators in C ++?

+3
source share
2 answers

In C ++, there are two operators, the result of which can always be determined at compile time regardless of the operand (s), which are sizeof[1] and ::[2].

Of course, there are many specific uses of other operators that can be resolved at compile time, for example, those listed in the standard for integer constant expressions.

[1] C99, ++, . sizeof, VLA, . ++ VLA .

[2], , . , - .

+7

Source: https://habr.com/ru/post/1773416/


All Articles