XIEITE_LANG_TYPE_/*???*/, XIEITE_LANG_MAJOR_/*???*/, XIEITE_LANG_MINOR_/*???*/, XIEITE_LANG_PATCH_/*???*/, XIEITE_LANG_VER()

Defined in header <xieite/pp/lang.hpp>

Macros for identifying the current language and its version (major, minor, patch). The macros are not mutually exclusive.


Definitions

#type
#define XIEITE_LANG_TYPE_/*???*/ /* boolean integer literal */
#define XIEITE_LANG_MAJOR_/*???*/ /* integer literal */
#define XIEITE_LANG_MINOR_/*???*/ /* integer literal */
#define XIEITE_LANG_PATCH_/*???*/ /* integer literal */
Append one of: C, CPP, CPP_CLI, CPP_CX, CPP_EMBEDDED, CPP_WINRT, CUDA, GLSL, HLSL, METAL, OBJ_C, OBJ_CPP, PSSL. See example.

#ver
#define XIEITE_LANG_VER(_type, _cmp, _major, .../* _minor, _patch */) /* boolean expression */
Allows up to two additional arguments for the minor and patch versions. Expands to an expression checking whether a language is present and the comparison of its version to the provided arguments.


Example

int main() {
	std::println("Is current language C++26? {}", XIEITE_LANG_VER(CPP, ==, 26));
}
Possible output:
Is current language C++26? true
[View in Compiler Explorer]