XTE _ LANG
Defined in header <xte/preproc/lang.hpp> Macros for detecting the current language. Definitions are compiler-dependent and might not be mutually exclusive.
Replace
NAME with one of: Definitions
#langDetects the presence of an language.#define XTE_LANG_ NAME /* boolean integer literal */
#major
Detects the major version of a language.#define XTE_LANG_ NAME _MAJOR /* integer literal */
#minor
Detects the minor version of a language.#define XTE_LANG_ NAME _MINOR /* integer literal */
#patch
Detects the patch version of a language.#define XTE_LANG_ NAME _PATCH /* integer literal */
#version
#define XTE_LANG (NAME ,OP ,MAJOR ,/* MINOR, PATCH */ ... )/* boolean expression */
OP must be <, <=, >, >=, ==, or !=. Allows up to two additional arguments for the minor and patch versions. Expands to an expression comparing a language's version to the provided arguments.Example
Possible preprocessor output:#if XTE_LANG (CPP , >=,2026 ) yup#else nop#endif
[View in Compiler Explorer]yup