Could someone please list a all compile time operators in available in C++?
There are two operators in C++ whose result can always be determined at compile-time, regardless of the operand(s), and those are sizeof
[1] and ::
[2].
Of course there are plenty of particular uses of other operators that can be resolved at compile-time, for example those listed in the standard for integer constant expressions.
[1] C99, unlike C++, has variable length array types. sizeof
applied to a VLA can't be determined at compile-time. Some C++ compilers provide VLAs as an extension.
[2] that is, it can be determined at compile time what entity is the result of the expression. If the entity is an object, then the object's value is another matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With