Corrade/Corrade.h file

Basic definitions and forward declarations for the Corrade namespace.

Namespaces

namespace Corrade
Root namespace.

Defines

#define CORRADE_MSVC_COMPATIBILITY new in Git master
MSVC compatibility.
#define CORRADE_MSVC2017_COMPATIBILITY
MSVC 2017 compatibility.
#define CORRADE_MSVC2015_COMPATIBILITY
MSVC 2015 compatibility.
#define CORRADE_BUILD_DEPRECATED
Build with deprecated features included.
#define CORRADE_BUILD_STATIC
Static library build.
#define CORRADE_BUILD_STATIC_UNIQUE_GLOBALS new in 2020.06
Static library build with globals unique across shared libraries.
#define CORRADE_BUILD_MULTITHREADED new in 2019.10
Multi-threaded build.
#define CORRADE_BUILD_CPU_RUNTIME_DISPATCH new in Git master
Build with runtime CPU dispatch.
#define CORRADE_IS_DEBUG_BUILD
Debug build.
#define CORRADE_CXX_STANDARD
C++ standard version.
#define CORRADE_TARGET_CXX14 new in Git master
C++14 target.
#define CORRADE_TARGET_CXX17 new in Git master
C++17 target.
#define CORRADE_TARGET_CXX20 new in Git master
C++20 target.
#define CORRADE_TARGET_UNIX
Unix target.
#define CORRADE_TARGET_APPLE
Apple target.
#define CORRADE_TARGET_IOS
iOS target
#define CORRADE_TARGET_IOS_SIMULATOR
iOS Simulator target
#define CORRADE_TARGET_WINDOWS
Windows target.
#define CORRADE_TARGET_WINDOWS_RT
Windows RT target.
#define CORRADE_TARGET_EMSCRIPTEN
Emscripten target.
#define CORRADE_TARGET_ANDROID
Android target.
#define CORRADE_TARGET_X86
x86 target
#define CORRADE_TARGET_ARM
ARM target.
#define CORRADE_TARGET_POWERPC new in 2019.10
PowerPC target.
#define CORRADE_TARGET_WASM new in Git master
WebAssembly target.
#define CORRADE_TARGET_32BIT new in Git master
32-bit target
#define CORRADE_TARGET_BIG_ENDIAN new in 2020.06
Big-Endian target.
#define CORRADE_TARGET_GCC new in 2020.06
GCC compiler.
#define CORRADE_TARGET_CLANG new in 2020.06
Clang compiler.
#define CORRADE_TARGET_APPLE_CLANG new in 2020.06
Apple's Clang compiler.
#define CORRADE_TARGET_CLANG_CL new in 2020.06
Clang-CL compiler.
#define CORRADE_TARGET_MSVC new in 2020.06
MSVC compiler.
#define CORRADE_TARGET_MINGW new in 2020.06
MinGW compiler.
#define CORRADE_TARGET_LIBCXX new in 2019.10
STL libc++ target.
#define CORRADE_TARGET_LIBSTDCXX new in 2019.10
STL libstdc++ target.
#define CORRADE_TARGET_DINKUMWARE new in 2019.10
STL Dinkumware target.
#define CORRADE_TARGET_SSE2 new in 2020.06
SSE2 target.
#define CORRADE_TARGET_SSE3 new in Git master
SSE3 target.
#define CORRADE_TARGET_SSSE3 new in Git master
SSSE3 target.
#define CORRADE_TARGET_SSE41 new in Git master
SSE4.1 target.
#define CORRADE_TARGET_SSE42 new in Git master
SSE4.2 target.
#define CORRADE_TARGET_POPCNT new in Git master
Target with POPCNT instructions.
#define CORRADE_TARGET_LZCNT new in Git master
Target with LZCNT instructions.
#define CORRADE_TARGET_BMI1 new in Git master
Target with BMI1 instructions.
#define CORRADE_TARGET_BMI2 new in Git master
Target with BMI2 instructions.
#define CORRADE_TARGET_AVX new in Git master
AVX target.
#define CORRADE_TARGET_AVX_F16C new in Git master
AVX target with F16C.
#define CORRADE_TARGET_AVX_FMA new in Git master
AVX target with FMA.
#define CORRADE_TARGET_AVX2 new in Git master
AVX2 target.
#define CORRADE_TARGET_AVX512F new in Git master
AVX-512 Foundation target.
#define CORRADE_TARGET_NEON new in Git master
NEON target.
#define CORRADE_TARGET_NEON_FMA new in Git master
NEON target with FMA.
#define CORRADE_TARGET_NEON_FP16 new in Git master
NEON target with FP16 vector arithmetic.
#define CORRADE_TARGET_SIMD128 new in Git master
SIMD128 target.
#define CORRADE_LONG_DOUBLE_SAME_AS_DOUBLE new in 2020.06
Whether long double has the same precision as double
#define CORRADE_NO_STD_IS_TRIVIALLY_TRAITS new in Git master
If the std::is_trivially_copyable family of type traits is not supported by the standard library.
#define CORRADE_CPU_USE_IFUNC new in Git master
GNU IFUNC is allowed to be used for runtime dispatch in the Cpu library.
#define CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT
PluginManager doesn't have dynamic plugin support on this platform.
#define CORRADE_TESTSUITE_TARGET_XCTEST
Target XCTest with TestSuite.
#define CORRADE_UTILITY_USE_ANSI_COLORS
Use ANSI escape sequences for colored debug output on Windows.

Define documentation

#define CORRADE_MSVC_COMPATIBILITY new in Git master

MSVC compatibility.

Defined if compatibility mode for Microsoft Visual C++ 2019+ without the /permissive- flag set is enabled.

#define CORRADE_MSVC2017_COMPATIBILITY

MSVC 2017 compatibility.

Defined if compatibility mode for MSVC 2017 is enabled.

#define CORRADE_MSVC2015_COMPATIBILITY

MSVC 2015 compatibility.

Defined if compatibility mode for MSVC 2015 is enabled.

#define CORRADE_BUILD_DEPRECATED

Build with deprecated features included.

Defined if the library contains deprecated features and APIs (which will be removed in the future). To preserve backward compatibility, Corrade is by default built with deprecated features included.

#define CORRADE_BUILD_STATIC

Static library build.

Defined if built as static libraries. Default are shared libraries.

#define CORRADE_BUILD_STATIC_UNIQUE_GLOBALS new in 2020.06

Static library build with globals unique across shared libraries.

Enabled by default in a static build. On Windows see also the CORRADE_BUILD_STATIC_UNIQUE_GLOBALS_DLL_NAME CMake option.

#define CORRADE_BUILD_MULTITHREADED new in 2019.10

Multi-threaded build.

Defined if the library is built in a way that makes it possible to safely use certain Corrade features simultaneously in multiple threads. In particular:

  • Utility::Debug and derived classes use it to have thread-local scoped output redirection and coloring
  • PluginManager::Manager uses it for thread-local plugin loading, unloading and management

Apart from these, Utility::Resource uses global data but isn't affected by this option, as majority of its operation is only reading from the global storage. All other functionality is free of any read/write access to global data.

#define CORRADE_BUILD_CPU_RUNTIME_DISPATCH new in Git master

Build with runtime CPU dispatch.

Defined if the library is built with performance-critical code paths optimized for multiple architectures (such as SSE or AVX on x86), with the best matching variant selected at runtime based on detected CPU features. If not defined, the library is built with just a single variant that's picked at compile time depending on target architecture flags being passed to the compiler.

The actual feature detection and dispatch both in the runtime and compile-time scenario is performed by the Cpu library. See Automatic cached dispatch for details and information about performance tradeoffs.

#define CORRADE_IS_DEBUG_BUILD

Debug build.

Gets defined if you (even transitively) link to any Corrade::* target in CMake and the build configuration (of your project, not Corrade itself) is Debug. No need to #include anything for this macro to be defined, it's supplied via a compiler flag by CMake.

Not guaranteed to be defined if using custom buildsystems or doing things differently than what's documented in Using Corrade with CMake.

#define CORRADE_CXX_STANDARD

C++ standard version.

Expands to __cplusplus macro on all sane compilers; on MSVC uses _MSVC_LANG if defined (since Visual Studio 2015 Update 3), otherwise reports C++11. The returned version is:

  • 201103 when C++11 is used
  • 201402 when C++14 is used
  • 201703 when C++17 is used
  • 202002 when C++20 is used
  • greater than 202002 when C++2b is used

Note that compilers that don't have full support for given standard may not return the exact value, in which case it's recommended to check that the reported value is greater than the previous standard, for example #if CORRADE_CXX_STANDARD > 201703 to test whether compiling as C++20. See also the CORRADE_TARGET_CXX14, CORRADE_TARGET_CXX17 and CORRADE_TARGET_CXX20 convenience macros that are defined if given standard is used.

Unlike most other CORRADE_* variables, this macro is not exposed to CMake as because the meaning is unclear in projects that combine more different C++ standards in a single project.

#define CORRADE_TARGET_CXX14 new in Git master

C++14 target.

Defined if the value of CORRADE_CXX_STANDARD is greater or equal to 201402.

#define CORRADE_TARGET_CXX17 new in Git master

C++17 target.

Defined if the value of CORRADE_CXX_STANDARD is greater or equal to 201703.

#define CORRADE_TARGET_CXX20 new in Git master

C++20 target.

Defined if the value of CORRADE_CXX_STANDARD is greater or equal to 202002.

#define CORRADE_TARGET_UNIX

Unix target.

Defined if the library is built for some Unix flavor (Linux, BSD, macOS, iOS, Android...). Note that while the behavior of Emscripten is closely emulating Unix systems, CORRADE_TARGET_UNIX is not defined there, only CORRADE_TARGET_EMSCRIPTEN.

#define CORRADE_TARGET_APPLE

Apple target.

Defined if the library is built for Apple platforms (macOS, iOS).

#define CORRADE_TARGET_IOS

iOS target

Defined if the library is built for iOS (device or simulator).

#define CORRADE_TARGET_IOS_SIMULATOR

iOS Simulator target

Defined if the library is built for iOS Simulator.

#define CORRADE_TARGET_WINDOWS

Windows target.

Defined if the library is built for Windows (desktop, Store or Phone).

#define CORRADE_TARGET_WINDOWS_RT

Windows RT target.

Defined if the library is built for Windows Store or Phone.

#define CORRADE_TARGET_EMSCRIPTEN

Emscripten target.

Defined if the library is built for Emscripten. Note that while the behavior of Emscripten is closely emulating Unix systems, CORRADE_TARGET_UNIX is not defined there, only CORRADE_TARGET_EMSCRIPTEN.

#define CORRADE_TARGET_ANDROID

Android target.

Defined if the library is built for Android.

#define CORRADE_TARGET_X86

x86 target

Defined if the library is built for x86 platforms (32 or 64-bit). Note that unlike other CORRADE_TARGET_* variables, this variable, CORRADE_TARGET_ARM, CORRADE_TARGET_POWERPC, CORRADE_TARGET_WASM, CORRADE_TARGET_32BIT, CORRADE_TARGET_BIG_ENDIAN and derived instruction set variables are not exposed in CMake because the meaning is unclear on platforms with multi-architecture binaries. If neither CORRADE_TARGET_X86, CORRADE_TARGET_ARM, CORRADE_TARGET_POWERPC nor CORRADE_TARGET_WASM is defined, the platform might be either a very old pre-WebAssembly CORRADE_TARGET_EMSCRIPTEN or any other that the library doesn't know about yet.

#define CORRADE_TARGET_ARM

ARM target.

Defined if the library is built for ARM platforms (32 or 64-bit). Note that unlike other CORRADE_TARGET_* variables, this variable, CORRADE_TARGET_X86, CORRADE_TARGET_POWERPC, CORRADE_TARGET_WASM, CORRADE_TARGET_32BIT, CORRADE_TARGET_BIG_ENDIAN and derived instruction set variables are not exposed in CMake because the meaning is unclear on platforms with multi-architecture binaries. If neither CORRADE_TARGET_X86, CORRADE_TARGET_ARM, CORRADE_TARGET_POWERPC nor CORRADE_TARGET_WASM is defined, the platform might be either a very old pre-WebAssembly CORRADE_TARGET_EMSCRIPTEN or any other that the library doesn't know about yet.

#define CORRADE_TARGET_POWERPC new in 2019.10

PowerPC target.

Defined if the library is built for PowerPC platforms (32 or 64-bit). Note that unlike other CORRADE_TARGET_* variables, this variable, CORRADE_TARGET_X86, CORRADE_TARGET_ARM, CORRADE_TARGET_WASM, CORRADE_TARGET_32BIT, CORRADE_TARGET_BIG_ENDIAN and derived instruction set variables are not exposed in CMake because the meaning is unclear on platforms with multi-architecture binaries. If neither CORRADE_TARGET_X86, CORRADE_TARGET_ARM, CORRADE_TARGET_POWERPC nor CORRADE_TARGET_WASM is defined, the platform might be either a very old pre-WebAssembly CORRADE_TARGET_EMSCRIPTEN or any other that the library doesn't know about yet.

#define CORRADE_TARGET_WASM new in Git master

WebAssembly target.

Defined if the library is built for WebAssembly (32 or 64-bit). Note that unlike other CORRADE_TARGET_* variables, this variable, CORRADE_TARGET_X86, CORRADE_TARGET_ARM, CORRADE_TARGET_POWERPC, CORRADE_TARGET_32BIT, CORRADE_TARGET_BIG_ENDIAN and derived instruction set variables are not exposed in CMake because the meaning is unclear on platforms with multi-architecture binaries. If neither CORRADE_TARGET_X86, CORRADE_TARGET_ARM, CORRADE_TARGET_POWERPC nor CORRADE_TARGET_WASM is defined, the platform might be either a very old pre-WebAssembly CORRADE_TARGET_EMSCRIPTEN or any other that the library doesn't know about yet.

#define CORRADE_TARGET_32BIT new in Git master

32-bit target

Defined if the library is built for a 32-bit target. Not defined on 64-bit platforms. Note that unlike other CORRADE_TARGET_* variables, this variable, CORRADE_TARGET_X86, CORRADE_TARGET_ARM, CORRADE_TARGET_POWERPC, CORRADE_TARGET_WASM, CORRADE_TARGET_BIG_ENDIAN and derived instruction set variables are not exposed in CMake because the meaning is unclear on platforms with multi-architecture binaries.

#define CORRADE_TARGET_BIG_ENDIAN new in 2020.06

Big-Endian target.

Defined when the platform defaults to Big-Endian (such as HP/PA RISC, Motorola 68k, Big-Endian MIPS, PowerPC and SPARC). Not defined on Little-Endian platforms (such as x86 and ARM). Note that some platforms are Bi-Endian, meaning the endianness can be switched at runtime (and thus can't be detected at compile-time), this macro only reflects the usual architecture default. Moreover, unlike other CORRADE_TARGET_* variables, this variable, CORRADE_TARGET_X86, CORRADE_TARGET_ARM, CORRADE_TARGET_POWERPC, CORRADE_TARGET_WASM and derived instruction set variables are not exposed in CMake because the meaning is unclear on platforms with multi-architecture binaries.

#define CORRADE_TARGET_GCC new in 2020.06

GCC compiler.

Defined if the code is being compiled by GCC or GCC-compatible Clang (which is CORRADE_TARGET_APPLE_CLANG but not CORRADE_TARGET_CLANG_CL, for example). While this variable is exposed in CMake as well, it's not guaranteed that the reported compiler is consistent between CMake and C++ — for example, a library can be built with GCC and then used via Clang.

Major GCC version number can be accessed using the __GNUC__ macro. Clang always reports itself as GCC 4.4, its version is reported in __clang_major__ instead.

#define CORRADE_TARGET_CLANG new in 2020.06

Clang compiler.

Defined if the code is being compiled by Clang or any of its variants (CORRADE_TARGET_APPLE_CLANG, CORRADE_TARGET_CLANG_CL). If this variable is defined, usually CORRADE_TARGET_GCC is also defined, except for Clang-CL. While this variable is exposed in CMake as well, it's not guaranteed that the reported compiler is consistent between CMake and C++ — for example, a library can be built with Clang and then used via GCC.

Major Clang version number can be accessed using the __clang_major__ macro, however note that Apple Clang (in Xcode) uses its own numbering — for example Clang 10 is actually Apple Clang 12.

#define CORRADE_TARGET_APPLE_CLANG new in 2020.06

Apple's Clang compiler.

Defined if the code is being compiled by Apple's Clang. If this variable is defined, CORRADE_TARGET_GCC and CORRADE_TARGET_CLANG are also defined. This is primarily useful when checking for Clang version, as Apple uses a different versioning scheme. While this variable is exposed in CMake as well, it's not guaranteed that the reported compiler is consistent between CMake and C++ — for example, a library can be built with Clang and then used via GCC.

Major Apple Clang version number can be accessed using the __clang_major__ macro, which is the same macro as vanilla Clang. There is no macro that exposes the matching vanilla Clang version, the only option is to use an external mapping table — for example Apple Clang 12 is actually Clang 10.

#define CORRADE_TARGET_CLANG_CL new in 2020.06

Clang-CL compiler.

Defined if the code is being compiled by Clang with a MSVC frontend. If this variable is defined, CORRADE_TARGET_CLANG and CORRADE_TARGET_MSVC is also defined (but CORRADE_TARGET_GCC not). While this variable is exposed in CMake as well, it's not guaranteed that the reported compiler is consistent between CMake and C++ — for example, a library can be built with Clang-CL and then used via MSVC.

Clang-CL uses the same versioning scheme as vanilla Clang, accessible using the __clang_major__ macro. It also exposes the _MSC_VER macro, reporting the MSVC version it's compatible with.

#define CORRADE_TARGET_MSVC new in 2020.06

MSVC compiler.

Defined if the code is being compiled by MSVC or Clang with a MSVC frontend. If this variable is defined, CORRADE_TARGET_CLANG might also be defined. While this variable is exposed in CMake as well, it's not guaranteed that the reported compiler is consistent between CMake and C++ — for example, a library can be built with MSVC and then used via Clang-CL.

MSVC version can be accessed using the _MSC_VER macro. The macro uses an internal version numbering, so for example MSVC 2019 16.7 (14.27) is reported as 1927.

#define CORRADE_TARGET_MINGW new in 2020.06

MinGW compiler.

Defined if the code is being compiled by GCC / Clang running under MinGW. If this variable is defined, CORRADE_TARGET_GCC and possibly also CORRADE_TARGET_CLANG are defined. While this variable is exposed in CMake as well, it's not guaranteed that the reported compiler is consistent between CMake and C++ — for example, a library can be built with MSVC and then used via Clang-CL.

#define CORRADE_TARGET_LIBCXX new in 2019.10

STL libc++ target.

Defined if the library is built against Clang libc++ STL implementation. This is most common on Apple macOS and iOS and on newer Android NDKs, it's also sometimes used on Linux. Note that unlike other CORRADE_TARGET_* variables, this variable, CORRADE_TARGET_LIBSTDCXX and CORRADE_TARGET_DINKUMWARE are not exposed in CMake because the detection is non-trivial.

Major libc++ version number can be accessed using the _LIBCPP_VERSION version macro. While libc++ can only be used with Clang (and not GCC), its version might or might not be the same as __clang_major__.

#define CORRADE_TARGET_LIBSTDCXX new in 2019.10

STL libstdc++ target.

Defined if the library is built against GCC libstdc++ STL implementation. This is most common on Linux and under MinGW, note that Clang is able to use libstdc++ as well. Note that unlike other CORRADE_TARGET_* variables, this variable, CORRADE_TARGET_LIBCXX and CORRADE_TARGET_DINKUMWARE are not exposed in CMake because the detection is non-trivial.

Major libstdc++ version number can be accessed using the _GLIBCXX_RELEASE macro, however it's available only since libstdc++ 7. Older versions define just __GLIBCXX__, which contains a release date (and the dates, of course, overlap for patch releases and can be just anything for custom GCC forks). If libstdc++ is used together with GCC, it can be assumed both have the same version; if libstdc++ is used together with Clang, the versions can be arbitrary.

#define CORRADE_TARGET_DINKUMWARE new in 2019.10

STL Dinkumware target.

Defined if the library is built against Dinkumware STL implementation (used by MSVC). Note that Clang is able to use this implementation as well. Note that unlike other CORRADE_TARGET_* variables, this variable, CORRADE_TARGET_LIBSTDCXX and CORRADE_TARGET_DINKUMWARE are not exposed in CMake because the detection is non-trivial.

The MSVC standard library is closely tied to a compiler version, thus _MSC_VER can be used to determine its version on both MSVC and Clang-CL.

#define CORRADE_TARGET_SSE2 new in 2020.06

SSE2 target.

Defined on x86 if Streaming SIMD Extensions 2 are enabled at compile time (-msse2 or higher on GCC/Clang, /arch:SSE2 or higher on MSVC). All x86-64 targets support SSE2. Implied by CORRADE_TARGET_SSE3.

#define CORRADE_TARGET_SSE3 new in Git master

SSE3 target.

Defined on x86 if Streaming SIMD Extensions 3 are enabled at compile time (on GCC/Clang it's -msse3 and higher, MSVC doesn't have a direct option and it's only implied by /arch:AVX). Superset of CORRADE_TARGET_SSE2, implied by CORRADE_TARGET_SSSE3.

#define CORRADE_TARGET_SSSE3 new in Git master

SSSE3 target.

Defined on x86 if Supplemental Streaming SIMD Extensions 3 are enabled at compile time (on GCC/Clang it's -mssse3 and higher, MSVC doesn't have a direct option and it's only implied by /arch:AVX). Superset of CORRADE_TARGET_SSE3, implied by CORRADE_TARGET_SSE41.

Note that certain older AMD processors have SSE4a but neither SSSE3 nor SSE4.1. Both can be however treated as a subset of SSE4.1 to a large extent, and it's recommended to use CORRADE_TARGET_SSE41 to detect those.

#define CORRADE_TARGET_SSE41 new in Git master

SSE4.1 target.

Defined on x86 if Streaming SIMD Extensions 4.1 are enabled at compile time (on GCC/Clang it's -msse4.1 and higher, MSVC doesn't have a direct option and it's only implied by /arch:AVX). Superset of CORRADE_TARGET_SSSE3, implied by CORRADE_TARGET_SSE42.

Note that certain older AMD processors have SSE4a but neither SSSE3 nor SSE4.1. Both can be however treated as a subset of SSE4.1 to a large extent, and it's recommended to use CORRADE_TARGET_SSE41 to detect those.

#define CORRADE_TARGET_SSE42 new in Git master

SSE4.2 target.

Defined on x86 if Streaming SIMD Extensions 4.2 are enabled at compile time (on GCC/Clang it's -msse4.2 and higher, MSVC doesn't have a direct option and it's only implied by /arch:AVX). Superset of CORRADE_TARGET_SSE41, implied by CORRADE_TARGET_AVX.

#define CORRADE_TARGET_POPCNT new in Git master

Target with POPCNT instructions.

Defined on x86 if POPCNT is enabled at compile time. On GCC/Clang it's -mpopcnt and is also implied by -msse4.2 and higher, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX. To avoid failures at runtime, prefer to detect its presence with Cpu::runtimeFeatures().

#define CORRADE_TARGET_LZCNT new in Git master

Target with LZCNT instructions.

Defined on x86 if LZCNT is enabled at compile time (on GCC/Clang it's -mlznct, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX2). However note that this instruction has encoding compatible with an earlier BSR instruction which has a slightly different behavior. To avoid wrong results if it isn't available, prefer to detect its presence with Cpu::runtimeFeatures() instead.

#define CORRADE_TARGET_BMI1 new in Git master

Target with BMI1 instructions.

Defined on x86 if BMI1 including the TZCNT instruction is enabled at compile time (on GCC/Clang it's -mbmi, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX2). However note that the TZCNT instruction has encoding compatible with an earlier BSF instruction which has a slightly different behavior. To avoid wrong results if it isn't available, prefer to detect its presence with Cpu::runtimeFeatures() instead.

Presence of this instruction set is not implied by CORRADE_TARGET_BMI2.

#define CORRADE_TARGET_BMI2 new in Git master

Target with BMI2 instructions.

Defined on x86 if BMI2 is enabled at compile time. On GCC/Clang it's -mbmi2, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX2. To avoid failures at runtime, prefer to detect its presence with Cpu::runtimeFeatures().

Presence of this instruction set does not imply CORRADE_TARGET_BMI1.

#define CORRADE_TARGET_AVX new in Git master

AVX target.

Defined on x86 if Advanced Vector Extensions are enabled at compile time (-mavx and higher on GCC/Clang, /arch:AVX on MSVC). Superset of CORRADE_TARGET_SSE42, implied by CORRADE_TARGET_AVX2.

#define CORRADE_TARGET_AVX_F16C new in Git master

AVX target with F16C.

Defined on x86 if the F16C instruction set is enabled at compile time. On GCC/Clang it's -mf16c, MSVC doesn't have a direct option but it's assumed to be implied by /arch:AVX2. To avoid failures at runtime, prefer to detect its presence with Cpu::runtimeFeatures().

#define CORRADE_TARGET_AVX_FMA new in Git master

AVX target with FMA.

Defined on x86 if the FMA3 instruction set is enabled at compile time. On GCC/Clang it's -mfma, MSVC doesn't have a direct option but it's assumes to be implied by /arch:AVX2. To avoid failures at runtime, prefer to detect its presence with Cpu::runtimeFeatures().

The FMA4 instruction set, which used to be supported only in certain range of AMD processors and isn't anymore, is not detected, and AMD switched to FMA3 since.

#define CORRADE_TARGET_AVX2 new in Git master

AVX2 target.

Defined on x86 if Advanced Vector Extensions 2 are enabled at compile time (-mavx2 and higher on GCC/Clang, /arch:AVX2 on MSVC). Superset of CORRADE_TARGET_AVX, implied by CORRADE_TARGET_AVX512F.

#define CORRADE_TARGET_AVX512F new in Git master

AVX-512 Foundation target.

Defined on x86 if AVX-512 Foundation instructions are enabled at compile time (-mavx512f and higher on GCC/Clang, /arch:AVX512 on MSVC). Superset of CORRADE_TARGET_AVX2.

#define CORRADE_TARGET_NEON new in Git master

NEON target.

Defined on ARM if ARM NEON instructions are enabled at compile time (-mfpu=neon on GCC/Clang, implicitly supported on ARM64). Implied by CORRADE_TARGET_NEON_FMA.

Apart from NEON, there's several other mutually incompatible ARM instruction sets. Detection for these will be added when the platforms become more widespread:

  • Helium, which is a low-power alternative to NEON
  • SVE, which is a HPC-focused alternative to NEON, in 2021 found mostly just on AWS Graviton
  • SVE2, which is a next-generation vector instruction set designed to be a successor to both NEON and SVE, scheduled to appear in production in around 2022
  • AMX, which is Apple's proprietary and patented instruction set available only on their own hardware

#define CORRADE_TARGET_NEON_FMA new in Git master

NEON target with FMA.

Defined on ARM if NEON FMA instructions are enabled at compile time (-mfpu=neon-vfpv4 on GCC/Clang on 32-bit ARM, implicitly supported on ARM64). Not defined if FMA is only available for scalar code and not for NEON. Superset of CORRADE_TARGET_NEON, implied by CORRADE_TARGET_NEON_FP16.

#define CORRADE_TARGET_NEON_FP16 new in Git master

NEON target with FP16 vector arithmetic.

Defined on ARM if ARMv8.2-a NEON FP16 vector arithmetic support is enabled at compile time (-march=armv8.2-a+fp16 on GCC/Clang). Superset of CORRADE_TARGET_NEON_FMA.

#define CORRADE_TARGET_SIMD128 new in Git master

SIMD128 target.

Defined on WebAssembly if 128-bit SIMD instructions are enabled at compile time (-msimd128 passed to Clang), and the compiler supports the finalized version of the intrinsics, which is since Clang 13 and Emscripten 2.0.18. Emscripten SDK 2.0.13 to 2.0.17 ship with a Clang that reports as 13 but isn't actually the final version.

#define CORRADE_LONG_DOUBLE_SAME_AS_DOUBLE new in 2020.06

Whether long double has the same precision as double

Defined on platforms where the long double type has a 64-bit precision instead of 80-bit, thus same as double. It's the case for MSVC (source), 32-bit Android (no reliable source found, sorry), Emscripten and Mac (but not iOS) with ARM processors. Emscripten is a bit special because it's long double is sometimes 80-bit, but its precision differs from the 80-bit representation elsewhere, so it's always treated as 64-bit. Note that even though the size and precision of double and long double may be the same, these are still two distinct types, similarly to how int and signed int behave the same but are treated as different types.

#define CORRADE_NO_STD_IS_TRIVIALLY_TRAITS new in Git master

If the std::is_trivially_copyable family of type traits is not supported by the standard library.

The std::is_trivially_constructible, std::is_trivially_default_constructible, std::is_trivially_copy_constructible, std::is_trivially_move_constructible, std::is_trivially_assignable, std::is_trivially_copy_assignable, std::is_trivially_move_assignable family of traits is not implemented on libstdc++ below version 5. Instead, legacy std::has_trivial_default_constructor, std::has_trivial_copy_constructor and std::has_trivial_copy_assign are available, with slightly different semantics (see e.g. https://stackoverflow.com/q/12754886 for more information). From libstdc++ 5 onwards these are marked as deprecated and libstdc++ 7 removes them, so alternatively there are __has_trivial_constructor(), __has_trivial_copy() and __has_trivial_assign() builtins that don't produce any deprecated warnings and are available until GCC 9 / Clang 10 at least — however note that for SFINAE you need to wrap them in std::integral_constant as otherwise GCC would throw errors similar to the following:

error: use of built-in trait ‘__has_trivial_copy(T)’ in function signature; use library traits instead

This macro is defined if the standard variants are not available. Unfortunately, when libstdc++ is used through Clang, there's no way to check for its version until libstdc++ 7, which added the _GLIBCXX_RELEASE macro. That means, when using Clang with libstdc++ 5 or 6, it will still report those traits as being unavailable. Both libc++ and MSVC STL have these traits in all versions supported by Corrade, so there the macro is defined always.

#define CORRADE_CPU_USE_IFUNC new in Git master

GNU IFUNC is allowed to be used for runtime dispatch in the Cpu library.

Defined if the Cpu library can perform runtime dispatch using GNU IFUNC, exposing the CORRADE_CPU_DISPATCHED_IFUNC() macro. Supported only on Linux with glibc and on Android with API 30+. See Automatic cached dispatch for details and information about performance tradeoffs.

#define CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT

PluginManager doesn't have dynamic plugin support on this platform.

Defined if the PluginManager library doesn't support dynamic plugin loading due to platform limitations. Defined on Emscripten, Windows RT, iOS and Android.

#define CORRADE_TESTSUITE_TARGET_XCTEST

Target XCTest with TestSuite.

Defined if the TestSuite library is targeting Xcode XCTest. Available only on Apple platforms. Enabled using CORRADE_TESTSUITE_TARGET_XCTEST CMake option when building Corrade.

#define CORRADE_UTILITY_USE_ANSI_COLORS

Use ANSI escape sequences for colored debug output on Windows.

By default colored output using Utility::Debug on Windows is done using WINAPI that has a limited functionality, because ANSI escape sequences are supported only on Windows 10 or when using non-standard console emulators. Available only on Windows, all other platforms use ANSI sequences implicitly. Enabled using CORRADE_UTILITY_USE_ANSI_COLORS CMake option when building Corrade.

Note that on Windows 10 you need to additionally enable ANSI color support in the console. This is done automatically when you link to the Corrade Main library.