TRLC Platform Library
1.0.0
Header-only C++ library for compile-time platform detection and abstraction
|
Namespaces | |
detail | |
traits | |
Classes | |
struct | ArchitectureInfo |
struct | CompilerVersion |
struct | CompilerInfo |
Consolidated compiler information structure. More... | |
struct | Version |
Library version information. More... | |
struct | PlatformReport |
Consolidated platform information structure. More... | |
struct | CppStandardInfo |
C++ standard information structure. More... | |
class | DebugUtils |
Debug utilities class with static methods. More... | |
struct | EndiannessInfo |
Comprehensive endianness information structure. More... | |
struct | FeatureSet |
Feature detection structure. More... | |
struct | PlatformInfo |
Platform information structure. More... | |
struct | TypeInfo |
struct | AlignedType |
Typedefs | |
using | AssertionHandler = void(*)(const char *expression, const char *file, int line, const char *function) |
Assertion handler function pointer type. More... | |
using | CacheLineAligned = AlignedType< 64 > |
using | PageAligned = AlignedType< 4096 > |
Functions | |
static CpuArchitecture | getCpuArchitecture () |
static ArchitectureInfo | getArchitectureInfo () |
static int | getPointerSize () |
static bool | hasSimdSupport () |
static bool | hasVectorInstructions () |
static bool | supportsCacheLineAlignment () |
static bool | is64BitArchitecture () |
static bool | is32BitArchitecture () |
static CompilerType | getCompilerType () |
Detects the current compiler type at compile time. More... | |
static CompilerVersion | getCompilerVersion () |
Gets the compiler version at compile time. More... | |
static const char * | getCompilerName () |
Gets the compiler name as a string. More... | |
static bool | hasBuiltinAttribute ([[maybe_unused]] const char *attribute_name) |
Checks if compiler supports __builtin attributes. More... | |
static bool | supportsInlineAssembly () |
Checks if compiler supports inline assembly. More... | |
static bool | hasColorDiagnostics () |
Checks if compiler supports colored diagnostics. More... | |
static CompilerInfo | getCompilerInfo () |
Get consolidated compiler information. More... | |
PlatformReport | getPlatformReport () |
void | initializePlatform () |
bool | isPlatformInitialized () |
std::string | getBriefPlatformSummary () |
void | printPlatformReport () |
static CppStandard | getCppStandard () |
Gets the current C++ standard version. More... | |
static CppStandardInfo | getCppStandardInfo () |
Gets comprehensive C++ standard information. More... | |
static long | getCppVersionMacro () |
Gets the __cplusplus macro value. More... | |
static bool | hasStructuredBindings () |
Checks if structured bindings are supported (C++17) More... | |
static bool | hasIfConstexpr () |
Checks if if constexpr is supported (C++17) More... | |
static bool | hasConcepts () |
Checks if concepts are supported (C++20) More... | |
static bool | hasCoroutines () |
Checks if coroutines are supported (C++20) More... | |
static bool | hasModules () |
Checks if modules are supported (C++20) More... | |
static bool | hasRanges () |
Checks if ranges library is supported (C++20) More... | |
static bool | hasFoldExpressions () |
Checks if fold expressions are supported (C++17) More... | |
static bool | hasInlineVariables () |
Checks if inline variables are supported (C++17) More... | |
static bool | hasConsteval () |
Checks if consteval is supported (C++20) More... | |
static bool | hasConstinit () |
Checks if constinit is supported (C++20) More... | |
static bool | hasDesignatedInitializers () |
Checks if designated initializers are supported (C++20) More... | |
static bool | hasThreeWayComparison () |
Checks if three-way comparison (spaceship operator) is supported (C++20) More... | |
static bool | isCpp17OrLater () |
Checks if the current C++ standard is at least C++17. More... | |
static bool | isCpp20OrLater () |
Checks if the current C++ standard is at least C++20. More... | |
static bool | isCpp23OrLater () |
Checks if the current C++ standard is at least C++23. More... | |
static bool | isExactlyCpp17 () |
Checks if the current C++ standard is exactly C++17. More... | |
static bool | isExactlyCpp20 () |
Checks if the current C++ standard is exactly C++20. More... | |
static bool | isExactlyCpp23 () |
Checks if the current C++ standard is exactly C++23. More... | |
void | defaultAssertionHandler (const char *expression, const char *file, int line, const char *function) |
Default assertion handler implementation. More... | |
static bool | isDebugBuild () |
static bool | isReleaseBuild () |
Check if the current build is a release build. More... | |
static bool | hasDebugInfo () |
Check if debug information is available. More... | |
static ByteOrder | getByteOrder () |
Get the system's byte order. More... | |
static EndiannessInfo | getEndiannessInfo () |
Get comprehensive endianness information. More... | |
static bool | isLittleEndian () |
Check if system is little-endian. More... | |
static bool | isBigEndian () |
Check if system is big-endian. More... | |
static uint16_t | byteSwap16 (uint16_t value) |
Swap bytes in a 16-bit value. More... | |
static uint32_t | byteSwap32 (uint32_t value) |
Swap bytes in a 32-bit value. More... | |
static uint64_t | byteSwap64 (uint64_t value) |
Swap bytes in a 64-bit value. More... | |
template<typename Type > | |
static Type | byteSwap (Type value) |
Generic byte swap function for integral types. More... | |
template<typename Type > | |
static Type | hostToNetwork (Type value) |
Convert from host byte order to network byte order (big-endian) More... | |
template<typename Type > | |
static Type | networkToHost (Type value) |
Convert from network byte order (big-endian) to host byte order. More... | |
static uint16_t | hostToNetworkShort (uint16_t hostshort) |
Convert 16-bit value from host to network byte order. More... | |
static uint32_t | hostToNetworkLong (uint32_t hostlong) |
Convert 32-bit value from host to network byte order. More... | |
static uint16_t | networkToHostShort (uint16_t netshort) |
Convert 16-bit value from network to host byte order. More... | |
static uint32_t | networkToHostLong (uint32_t netlong) |
Convert 32-bit value from network to host byte order. More... | |
static bool | areByteOrdersCompatible (ByteOrder order1, ByteOrder order2) |
Check if two byte orders are compatible (no swapping needed) More... | |
static ByteOrder | getOppositeByteOrder (ByteOrder order) |
Get the opposite byte order. More... | |
template<typename Type > | |
static Type | convertByteOrder (Type value, ByteOrder from_order, ByteOrder to_order) |
Convert value between specified byte orders. More... | |
static bool | hasExceptions () |
Detects if C++ exceptions are enabled. More... | |
static bool | hasRtti () |
Detects if RTTI (Runtime Type Information) is enabled. More... | |
static bool | hasThreads () |
Detects if threading support is available. More... | |
static bool | hasAtomicOperations () |
Detects if atomic operations are supported. More... | |
static bool | hasInlineAssembly () |
Detects if inline assembly is supported. More... | |
static bool | hasVectorIntrinsics () |
Detects if vector intrinsics are available. More... | |
static bool | hasStackProtection () |
Detects if stack protection is enabled. More... | |
static bool | hasAddressSanitizer () |
Detects if AddressSanitizer is enabled. More... | |
static bool | hasThreadSanitizer () |
Detects if ThreadSanitizer is enabled. More... | |
static bool | hasMemorySanitizer () |
Detects if MemorySanitizer is enabled. More... | |
static bool | hasUndefinedBehaviorSanitizer () |
Detects if UndefinedBehaviorSanitizer is enabled. More... | |
bool | hasSseSupport () |
Detects SSE support at runtime. More... | |
bool | hasSse2Support () |
Detects SSE2 support at runtime. More... | |
bool | hasSse3Support () |
Detects SSE3 support at runtime. More... | |
bool | hasSse41Support () |
Detects SSE4.1 support at runtime. More... | |
bool | hasSse42Support () |
Detects SSE4.2 support at runtime. More... | |
bool | hasAvxSupport () |
Detects AVX support at runtime. More... | |
bool | hasAvx2Support () |
Detects AVX2 support at runtime. More... | |
bool | hasAvx512fSupport () |
Detects AVX-512F support at runtime. More... | |
bool | hasNeonSupport () |
Detects ARM NEON support. More... | |
bool | hasHardwareAes () |
Detects hardware AES support. More... | |
bool | hasHardwareRandom () |
Detects hardware random number generation support. More... | |
static FeatureSet | getFeatureSet () |
Gets a complete feature set with all detected features. More... | |
static bool | hasLanguageFeature (LanguageFeature feature) |
Checks if a specific language feature is available. More... | |
bool | hasRuntimeFeature (RuntimeFeature feature) |
Checks if a specific runtime feature is available. More... | |
template<LanguageFeature TFeature> | |
static bool | hasFeature () |
Generic template function for feature testing. More... | |
static bool | supportsNodecard () |
Check if compiler supports nodiscard attribute. More... | |
static bool | supportsDeprecated () |
Check if compiler supports deprecated attribute. More... | |
static bool | supportsFallthrough () |
Check if compiler supports fallthrough attribute. More... | |
static bool | hasAttributeSupport (const char *) |
Check if compiler supports a specific C++ attribute. More... | |
static OperatingSystem | getOperatingSystem () |
Detects the current operating system at compile time. More... | |
static EnvironmentType | getEnvironmentType () |
Detects the current environment type at compile time. More... | |
static PlatformInfo | getPlatformInfo () |
Gets comprehensive platform information. More... | |
static bool | hasPosixApi () |
Checks if the platform supports POSIX APIs. More... | |
static bool | hasWin32Api () |
Checks if the platform supports Win32 APIs. More... | |
static bool | supportsCaseSensitiveFilesystem () |
Checks if the platform supports case-sensitive filesystems. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::exceptions > () |
Template specializations for specific language features Provides optimized compile-time constants for individual features. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::rtti > () |
Specialization for RTTI - Direct function call for better optimization. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::threads > () |
Specialization for threads - Direct function call for better optimization. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::atomic_operations > () |
Specialization for atomic operations - Direct function call for better optimization. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::inline_assembly > () |
Specialization for inline assembly - Direct function call for better optimization. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::vector_intrinsics > () |
Specialization for vector intrinsics - Direct function call for better optimization. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::stack_protection > () |
Specialization for stack protection - Direct function call for better optimization. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::address_sanitizer > () |
Specialization for AddressSanitizer - Direct function call for better optimization. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::thread_sanitizer > () |
Specialization for ThreadSanitizer - Direct function call for better optimization. More... | |
template<> | |
static bool | hasFeature< LanguageFeature::memory_sanitizer > () |
Specialization for MemorySanitizer - Direct function call for better optimization. More... | |
template<RuntimeFeature TFeature> | |
bool | hasRuntimeFeature () |
Template function for runtime feature testing. More... | |
template<> | |
bool | hasRuntimeFeature< RuntimeFeature::sse > () |
template<> | |
bool | hasRuntimeFeature< RuntimeFeature::sse2 > () |
template<> | |
bool | hasRuntimeFeature< RuntimeFeature::sse3 > () |
template<> | |
bool | hasRuntimeFeature< RuntimeFeature::sse4_1 > () |
template<> | |
bool | hasRuntimeFeature< RuntimeFeature::sse4_2 > () |
template<> | |
bool | hasRuntimeFeature< RuntimeFeature::avx > () |
template<> | |
bool | hasRuntimeFeature< RuntimeFeature::avx2 > () |
template<> | |
bool | hasRuntimeFeature< RuntimeFeature::avx512f > () |
template<> | |
bool | hasRuntimeFeature< RuntimeFeature::neon > () |
template<typename Type > | |
static size_t | getTypeSize () |
template<typename Type > | |
static size_t | getTypeAlignment () |
static size_t | getCacheLineSize () |
Get the cache line size for the current platform. More... | |
static size_t | getPageSize () |
Get the page size for the current platform. More... | |
template<typename Type > | |
static size_t | calculatePadding () |
template<typename Type > | |
static bool | hasInternalPadding () |
template<typename Type , size_t TExpectedSize> | |
static bool | verifyTypeSize () |
template<typename Type , size_t TExpectedAlignment> | |
static bool | verifyTypeAlignment () |
template<typename Type > | |
static bool | isCacheLineAligned () |
Verify that a type is suitably aligned for cache line optimization. More... | |
template<typename Type > | |
static bool | isPageAligned () |
Verify that a type is suitably aligned for page boundaries. More... | |
static size_t | alignedSize (size_t size, size_t alignment) |
Calculate the aligned size for a given alignment. More... | |
static uintptr_t | alignedAddress (uintptr_t addr, size_t alignment) |
Calculate the aligned address for a given alignment. More... | |
static bool | isAligned (uintptr_t addr, size_t alignment) |
Check if an address is aligned to the specified boundary. More... | |
bool | isAligned (const void *ptr, size_t alignment) |
Check if a pointer is aligned to the specified boundary. More... | |
using trlc::platform::AssertionHandler = typedef void (*)(const char* expression, const char* file, int line, const char* function) |
Assertion handler function pointer type.
This function type is used for custom assertion handlers. When an assertion fails, the registered handler is called with detailed information about the assertion failure.
expression | The stringified expression that failed |
file | The source file where the assertion failed |
line | The line number where the assertion failed |
function | The function name where the assertion failed |
using trlc::platform::CacheLineAligned = typedef AlignedType<64> |
Definition at line 317 of file typeinfo.hpp.
using trlc::platform::PageAligned = typedef AlignedType<4096> |
Definition at line 331 of file typeinfo.hpp.
|
strong |
Byte order enumeration.
Represents different byte ordering schemes used by CPU architectures.
Enumerator | |
---|---|
unknown | Unknown byte order. |
little_endian | Little-endian (LSB first) |
big_endian | Big-endian (MSB first) |
mixed_endian | Mixed endianness (rare architectures) |
Definition at line 33 of file endianness.hpp.
|
strong |
Compiler identification enumeration.
Represents the detected compiler type at compile time. This enumeration covers all major C++ compilers used in modern development, enabling compiler-specific optimizations and feature detection.
Detection uses compiler-specific predefined macros in order of specificity:
Definition at line 120 of file compiler.hpp.
|
strong |
C++ standard enumeration.
Represents different C++ standard versions with their corresponding __cplusplus macro values for precise version detection.
Definition at line 24 of file cpp_standard.hpp.
|
strong |
CPU architecture enumeration.
Represents different CPU architectures that can be detected at compile time. This enumeration covers all major CPU architecture families used in modern computing from embedded systems to high-performance servers.
Definition at line 105 of file architecture.hpp.
|
strong |
Environment type identification enumeration.
Represents the target environment type for the application.
Enumerator | |
---|---|
unknown | Unknown environment type. |
desktop | Desktop/workstation environment. |
server | Server environment. |
embedded | Embedded system environment. |
mobile | Mobile device environment. |
Definition at line 41 of file platform.hpp.
|
strong |
Language feature enumeration.
Represents compile-time detectable language and compiler features. These features are determined at compile time based on compiler capabilities and build settings.
Definition at line 49 of file features.hpp.
|
strong |
Operating system identification enumeration.
Represents the detected operating system type at compile time.
Definition at line 21 of file platform.hpp.
|
strong |
Runtime feature enumeration.
Represents CPU features that may require runtime detection. These features depend on the actual hardware capabilities and may not be detectable at compile time.
Definition at line 70 of file features.hpp.
|
static |
Calculate the aligned address for a given alignment.
Rounds up an address to the next boundary that satisfies the alignment requirement.
addr | The original address |
alignment | The required alignment (must be power of 2) |
Definition at line 432 of file typeinfo.hpp.
|
static |
Calculate the aligned size for a given alignment.
Rounds up a size to the next boundary that satisfies the alignment requirement.
size | The original size |
alignment | The required alignment (must be power of 2) |
Definition at line 419 of file typeinfo.hpp.
Check if two byte orders are compatible (no swapping needed)
order1 | First byte order |
order2 | Second byte order |
Definition at line 464 of file endianness.hpp.
|
static |
Generic byte swap function for integral types.
Automatically selects the appropriate byte swap implementation based on the size of the type. Supports signed and unsigned integral types.
Type | Integral type to byte swap |
value | Value to byte swap |
Definition at line 321 of file endianness.hpp.
|
static |
Swap bytes in a 16-bit value.
value | 16-bit value to byte swap |
Definition at line 286 of file endianness.hpp.
|
static |
Swap bytes in a 32-bit value.
value | 32-bit value to byte swap |
Definition at line 296 of file endianness.hpp.
|
static |
Swap bytes in a 64-bit value.
value | 64-bit value to byte swap |
Definition at line 306 of file endianness.hpp.
|
static |
Definition at line 230 of file typeinfo.hpp.
|
static |
Convert value between specified byte orders.
Type | Integral type to convert |
value | Value to convert |
from_order | Source byte order |
to_order | Target byte order |
Definition at line 499 of file endianness.hpp.
|
inline |
Default assertion handler implementation.
This is the default handler for assertion failures. It prints detailed information about the assertion failure to stderr and then terminates the program.
expression | The stringified expression that failed |
file | The source file where the assertion failed |
line | The line number where the assertion failed |
function | The function name where the assertion failed |
|
static |
Definition at line 590 of file architecture.hpp.
|
inline |
|
static |
Get the system's byte order.
Returns the byte order of the current system. Uses compile-time detection when possible, falls back to runtime detection for unknown cases.
Definition at line 159 of file endianness.hpp.
|
static |
Get the cache line size for the current platform.
Returns the cache line size in bytes. This is used for optimizing memory access patterns and avoiding false sharing in concurrent code.
Definition at line 119 of file typeinfo.hpp.
|
static |
Get consolidated compiler information.
Returns a CompilerInfo structure containing all detected compiler information in a single convenient package.
Definition at line 517 of file compiler.hpp.
|
static |
Gets the compiler name as a string.
Returns a human-readable string representation of the compiler name.
Definition at line 398 of file compiler.hpp.
|
static |
Detects the current compiler type at compile time.
Uses compiler-specific predefined macros to identify the compiler. Detection is performed entirely at compile time with zero runtime cost.
Definition at line 323 of file compiler.hpp.
|
static |
Gets the compiler version at compile time.
Extracts version information from compiler-specific macros.
Definition at line 357 of file compiler.hpp.
|
static |
Gets the current C++ standard version.
Definition at line 171 of file cpp_standard.hpp.
|
static |
Gets comprehensive C++ standard information.
Definition at line 179 of file cpp_standard.hpp.
|
static |
Gets the __cplusplus macro value.
Definition at line 189 of file cpp_standard.hpp.
|
static |
Definition at line 537 of file architecture.hpp.
|
static |
Get comprehensive endianness information.
Returns a complete EndiannessInfo structure with byte order and convenient boolean flags.
Definition at line 178 of file endianness.hpp.
|
static |
Detects the current environment type at compile time.
Determines the target environment based on platform characteristics and available compile-time information.
Definition at line 138 of file platform.hpp.
|
static |
Gets a complete feature set with all detected features.
Definition at line 553 of file features.hpp.
|
static |
Detects the current operating system at compile time.
Uses platform-specific predefined macros to identify the operating system. Detection is performed entirely at compile time with zero runtime cost.
Definition at line 98 of file platform.hpp.
Get the opposite byte order.
order | Input byte order |
Definition at line 478 of file endianness.hpp.
|
static |
Get the page size for the current platform.
Returns the memory page size in bytes. This is useful for memory allocation optimizations and system-level memory management.
Definition at line 143 of file typeinfo.hpp.
|
static |
Gets comprehensive platform information.
Returns a complete PlatformInfo structure with operating system, environment type, human-readable names, and kernel family.
Definition at line 172 of file platform.hpp.
|
inline |
|
static |
Definition at line 636 of file architecture.hpp.
|
static |
Definition at line 104 of file typeinfo.hpp.
|
static |
Definition at line 84 of file typeinfo.hpp.
|
static |
Detects if AddressSanitizer is enabled.
Definition at line 298 of file features.hpp.
|
static |
Detects if atomic operations are supported.
Definition at line 244 of file features.hpp.
|
static |
Check if compiler supports a specific C++ attribute.
attribute_name | Name of the attribute to check |
Definition at line 73 of file macros.hpp.
|
inline |
Detects AVX2 support at runtime.
Definition at line 480 of file features.hpp.
|
inline |
Detects AVX-512F support at runtime.
Definition at line 492 of file features.hpp.
|
inline |
Detects AVX support at runtime.
Definition at line 468 of file features.hpp.
|
static |
Checks if compiler supports __builtin attributes.
Determines if the current compiler supports GCC-style __builtin functions for the specified attribute.
attribute_name | Name of the attribute to check (unused in constexpr context) |
Definition at line 428 of file compiler.hpp.
|
static |
Checks if compiler supports colored diagnostics.
Determines if the compiler can output colored error/warning messages.
Definition at line 456 of file compiler.hpp.
|
static |
Checks if concepts are supported (C++20)
Definition at line 223 of file cpp_standard.hpp.
|
static |
Checks if consteval is supported (C++20)
Definition at line 298 of file cpp_standard.hpp.
|
static |
Checks if constinit is supported (C++20)
Definition at line 310 of file cpp_standard.hpp.
|
static |
Checks if coroutines are supported (C++20)
Definition at line 235 of file cpp_standard.hpp.
|
static |
Check if debug information is available.
Determines whether debug information (symbols, line numbers, etc.) is likely to be available in the current build. This is an approximation based on compiler flags and build configuration.
|
static |
Checks if designated initializers are supported (C++20)
Definition at line 322 of file cpp_standard.hpp.
|
static |
Detects if C++ exceptions are enabled.
Definition at line 196 of file features.hpp.
|
static |
Generic template function for feature testing.
TFeature | Must be LanguageFeature enum value |
Definition at line 659 of file features.hpp.
|
static |
Specialization for AddressSanitizer - Direct function call for better optimization.
Definition at line 77 of file traits.hpp.
|
static |
Specialization for atomic operations - Direct function call for better optimization.
Definition at line 53 of file traits.hpp.
|
static |
Template specializations for specific language features Provides optimized compile-time constants for individual features.
Specialization for exceptions - Direct function call for better optimization
Definition at line 35 of file traits.hpp.
|
static |
Specialization for inline assembly - Direct function call for better optimization.
Definition at line 59 of file traits.hpp.
|
static |
Specialization for MemorySanitizer - Direct function call for better optimization.
Definition at line 89 of file traits.hpp.
|
static |
Specialization for RTTI - Direct function call for better optimization.
Definition at line 41 of file traits.hpp.
|
static |
Specialization for stack protection - Direct function call for better optimization.
Definition at line 71 of file traits.hpp.
|
static |
Specialization for ThreadSanitizer - Direct function call for better optimization.
Definition at line 83 of file traits.hpp.
|
static |
Specialization for threads - Direct function call for better optimization.
Definition at line 47 of file traits.hpp.
|
static |
Specialization for vector intrinsics - Direct function call for better optimization.
Definition at line 65 of file traits.hpp.
|
static |
Checks if fold expressions are supported (C++17)
Definition at line 274 of file cpp_standard.hpp.
|
inline |
Detects hardware AES support.
Definition at line 522 of file features.hpp.
|
inline |
Detects hardware random number generation support.
Definition at line 536 of file features.hpp.
|
static |
Checks if if constexpr is supported (C++17)
Definition at line 211 of file cpp_standard.hpp.
|
static |
Detects if inline assembly is supported.
Definition at line 260 of file features.hpp.
|
static |
Checks if inline variables are supported (C++17)
Definition at line 286 of file cpp_standard.hpp.
|
static |
Definition at line 254 of file typeinfo.hpp.
|
static |
Checks if a specific language feature is available.
feature | Language feature to check |
Definition at line 588 of file features.hpp.
|
static |
Detects if MemorySanitizer is enabled.
Definition at line 332 of file features.hpp.
|
static |
Checks if modules are supported (C++20)
Definition at line 249 of file cpp_standard.hpp.
|
inline |
Detects ARM NEON support.
Definition at line 504 of file features.hpp.
|
static |
Checks if the platform supports POSIX APIs.
Determines if the current platform provides POSIX-compliant APIs based on platform detection and standard macros.
Definition at line 243 of file platform.hpp.
|
static |
Checks if ranges library is supported (C++20)
Definition at line 262 of file cpp_standard.hpp.
|
static |
Detects if RTTI (Runtime Type Information) is enabled.
Definition at line 210 of file features.hpp.
bool trlc::platform::hasRuntimeFeature | ( | ) |
Template function for runtime feature testing.
TFeature | Must be RuntimeFeature enum value |
Definition at line 103 of file traits.hpp.
|
inline |
Checks if a specific runtime feature is available.
feature | Runtime feature to check |
Definition at line 623 of file features.hpp.
|
inline |
Definition at line 134 of file traits.hpp.
|
inline |
Definition at line 139 of file traits.hpp.
|
inline |
Definition at line 144 of file traits.hpp.
|
inline |
Definition at line 149 of file traits.hpp.
|
inline |
Definition at line 109 of file traits.hpp.
|
inline |
Definition at line 114 of file traits.hpp.
|
inline |
Definition at line 119 of file traits.hpp.
|
inline |
Definition at line 124 of file traits.hpp.
|
inline |
Definition at line 129 of file traits.hpp.
|
static |
Definition at line 681 of file architecture.hpp.
|
inline |
Detects SSE2 support at runtime.
Definition at line 420 of file features.hpp.
|
inline |
Detects SSE3 support at runtime.
Definition at line 432 of file features.hpp.
|
inline |
Detects SSE4.1 support at runtime.
Definition at line 444 of file features.hpp.
|
inline |
Detects SSE4.2 support at runtime.
Definition at line 456 of file features.hpp.
|
inline |
Detects SSE support at runtime.
Definition at line 408 of file features.hpp.
|
static |
Detects if stack protection is enabled.
Definition at line 282 of file features.hpp.
|
static |
Checks if structured bindings are supported (C++17)
Definition at line 199 of file cpp_standard.hpp.
|
static |
Detects if threading support is available.
Definition at line 230 of file features.hpp.
|
static |
Detects if ThreadSanitizer is enabled.
Definition at line 315 of file features.hpp.
|
static |
Checks if three-way comparison (spaceship operator) is supported (C++20)
Definition at line 334 of file cpp_standard.hpp.
|
static |
Detects if UndefinedBehaviorSanitizer is enabled.
Definition at line 349 of file features.hpp.
|
static |
Definition at line 728 of file architecture.hpp.
|
static |
Detects if vector intrinsics are available.
Definition at line 274 of file features.hpp.
|
static |
Checks if the platform supports Win32 APIs.
Determines if the current platform provides Win32 APIs based on Windows-specific macros.
Definition at line 272 of file platform.hpp.
|
static |
Convert from host byte order to network byte order (big-endian)
Network byte order is defined as big-endian. This function converts values from the host's native byte order to network byte order.
Type | Integral type to convert |
value | Value in host byte order |
Definition at line 366 of file endianness.hpp.
|
static |
Convert 32-bit value from host to network byte order.
Equivalent to the POSIX htonl() function.
hostlong | 32-bit value in host byte order |
Definition at line 425 of file endianness.hpp.
|
static |
Convert 16-bit value from host to network byte order.
Equivalent to the POSIX htons() function.
hostshort | 16-bit value in host byte order |
Definition at line 413 of file endianness.hpp.
|
inline |
|
static |
Definition at line 849 of file architecture.hpp.
|
static |
Definition at line 813 of file architecture.hpp.
|
inline |
Check if a pointer is aligned to the specified boundary.
ptr | The pointer to check |
alignment | The alignment boundary |
Definition at line 456 of file typeinfo.hpp.
|
static |
Check if an address is aligned to the specified boundary.
addr | The address to check |
alignment | The alignment boundary |
Definition at line 443 of file typeinfo.hpp.
|
static |
Check if system is big-endian.
Definition at line 197 of file endianness.hpp.
|
static |
Verify that a type is suitably aligned for cache line optimization.
Checks whether a type's alignment is sufficient for cache line optimization.
Type | The type to verify |
Definition at line 389 of file typeinfo.hpp.
|
static |
Checks if the current C++ standard is at least C++17.
Definition at line 346 of file cpp_standard.hpp.
|
static |
Checks if the current C++ standard is at least C++20.
Definition at line 354 of file cpp_standard.hpp.
|
static |
Checks if the current C++ standard is at least C++23.
Definition at line 362 of file cpp_standard.hpp.
|
static |
|
static |
Checks if the current C++ standard is exactly C++17.
Definition at line 370 of file cpp_standard.hpp.
|
static |
Checks if the current C++ standard is exactly C++20.
Definition at line 378 of file cpp_standard.hpp.
|
static |
Checks if the current C++ standard is exactly C++23.
Definition at line 386 of file cpp_standard.hpp.
|
static |
Check if system is little-endian.
Definition at line 188 of file endianness.hpp.
|
static |
Verify that a type is suitably aligned for page boundaries.
Checks whether a type's alignment is sufficient for page boundary alignment.
Type | The type to verify |
Definition at line 402 of file typeinfo.hpp.
|
inline |
|
static |
Check if the current build is a release build.
Determines whether the code was compiled with release settings enabled. This is the logical inverse of isDebugBuild().
|
static |
Convert from network byte order (big-endian) to host byte order.
Network byte order is defined as big-endian. This function converts values from network byte order to the host's native byte order.
Type | Integral type to convert |
value | Value in network byte order (big-endian) |
Definition at line 389 of file endianness.hpp.
|
static |
Convert 32-bit value from network to host byte order.
Equivalent to the POSIX ntohl() function.
netlong | 32-bit value in network byte order |
Definition at line 449 of file endianness.hpp.
|
static |
Convert 16-bit value from network to host byte order.
Equivalent to the POSIX ntohs() function.
netshort | 16-bit value in network byte order |
Definition at line 437 of file endianness.hpp.
|
inline |
|
static |
Definition at line 774 of file architecture.hpp.
|
static |
Checks if the platform supports case-sensitive filesystems.
Determines if the filesystem is case-sensitive based on platform characteristics and common filesystem behavior.
Definition at line 291 of file platform.hpp.
|
static |
Check if compiler supports deprecated attribute.
Definition at line 44 of file macros.hpp.
|
static |
Check if compiler supports fallthrough attribute.
Definition at line 58 of file macros.hpp.
|
static |
Checks if compiler supports inline assembly.
Determines if the current compiler supports inline assembly syntax.
Definition at line 441 of file compiler.hpp.
|
static |
Check if compiler supports nodiscard attribute.
Definition at line 30 of file macros.hpp.
|
static |
Definition at line 376 of file typeinfo.hpp.
|
static |
Definition at line 355 of file typeinfo.hpp.