TRLC Platform Library  1.0.0
Header-only C++ library for compile-time platform detection and abstraction
trlc::platform::FeatureSet Struct Reference

Feature detection structure. More...

#include <trlc/platform/features.hpp>

Public Member Functions

bool hasRuntimeFeature (RuntimeFeature feature) const
 Checks if a specific runtime feature is available. More...
 

Static Public Member Functions

static bool hasLanguageFeature (LanguageFeature feature) const
 Checks if a specific language feature is available. More...
 

Public Attributes

bool has_exceptions
 Exception handling available. More...
 
bool has_rtti
 RTTI available. More...
 
bool has_threads
 Threading support available. More...
 
bool has_atomic
 Atomic operations available. More...
 
bool has_inline_asm
 Inline assembly available. More...
 
bool has_vector_intrinsics
 Vector intrinsics available. More...
 
bool has_stack_protection
 Stack protection enabled. More...
 
bool has_address_sanitizer
 AddressSanitizer enabled. More...
 
bool has_thread_sanitizer
 ThreadSanitizer enabled. More...
 
bool has_memory_sanitizer
 MemorySanitizer enabled. More...
 
bool has_undefined_behavior_sanitizer
 UBSan enabled. More...
 
bool has_sse
 SSE support. More...
 
bool has_sse2
 SSE2 support. More...
 
bool has_sse3
 SSE3 support. More...
 
bool has_sse4_1
 SSE4.1 support. More...
 
bool has_sse4_2
 SSE4.2 support. More...
 
bool has_avx
 AVX support. More...
 
bool has_avx2
 AVX2 support. More...
 
bool has_avx512f
 AVX-512F support. More...
 
bool has_neon
 ARM NEON support. More...
 
bool has_hardware_aes
 Hardware AES support. More...
 
bool has_hardware_random
 Hardware RNG support. More...
 

Detailed Description

Feature detection structure.

Contains both compile-time language features and runtime CPU features. Language features are determined at compile time, while runtime features may require CPU feature detection at runtime.

Definition at line 91 of file features.hpp.

Member Function Documentation

◆ hasLanguageFeature()

static bool trlc::platform::FeatureSet::hasLanguageFeature ( LanguageFeature  feature) const
inlinestatic

Checks if a specific language feature is available.

Parameters
featureLanguage feature to check
Returns
true if feature is available

Definition at line 123 of file features.hpp.

◆ hasRuntimeFeature()

bool trlc::platform::FeatureSet::hasRuntimeFeature ( RuntimeFeature  feature) const
inline

Checks if a specific runtime feature is available.

Parameters
featureRuntime feature to check
Returns
true if feature is available
Note
This is not constexpr as it may require runtime detection

Definition at line 158 of file features.hpp.

Member Data Documentation

◆ has_address_sanitizer

bool trlc::platform::FeatureSet::has_address_sanitizer

AddressSanitizer enabled.

Definition at line 100 of file features.hpp.

◆ has_atomic

bool trlc::platform::FeatureSet::has_atomic

Atomic operations available.

Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/core.hpp.

Definition at line 96 of file features.hpp.

◆ has_avx

bool trlc::platform::FeatureSet::has_avx

AVX support.

Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/core.hpp.

Definition at line 111 of file features.hpp.

◆ has_avx2

bool trlc::platform::FeatureSet::has_avx2

AVX2 support.

Definition at line 112 of file features.hpp.

◆ has_avx512f

bool trlc::platform::FeatureSet::has_avx512f

AVX-512F support.

Definition at line 113 of file features.hpp.

◆ has_exceptions

bool trlc::platform::FeatureSet::has_exceptions

Exception handling available.

Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/core.hpp.

Definition at line 93 of file features.hpp.

◆ has_hardware_aes

bool trlc::platform::FeatureSet::has_hardware_aes

Hardware AES support.

Definition at line 115 of file features.hpp.

◆ has_hardware_random

bool trlc::platform::FeatureSet::has_hardware_random

Hardware RNG support.

Definition at line 116 of file features.hpp.

◆ has_inline_asm

bool trlc::platform::FeatureSet::has_inline_asm

Inline assembly available.

Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/core.hpp.

Definition at line 97 of file features.hpp.

◆ has_memory_sanitizer

bool trlc::platform::FeatureSet::has_memory_sanitizer

MemorySanitizer enabled.

Definition at line 102 of file features.hpp.

◆ has_neon

bool trlc::platform::FeatureSet::has_neon

ARM NEON support.

Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/core.hpp.

Definition at line 114 of file features.hpp.

◆ has_rtti

bool trlc::platform::FeatureSet::has_rtti

RTTI available.

Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/core.hpp.

Definition at line 94 of file features.hpp.

◆ has_sse

bool trlc::platform::FeatureSet::has_sse

SSE support.

Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/core.hpp.

Definition at line 106 of file features.hpp.

◆ has_sse2

bool trlc::platform::FeatureSet::has_sse2

SSE2 support.

Definition at line 107 of file features.hpp.

◆ has_sse3

bool trlc::platform::FeatureSet::has_sse3

SSE3 support.

Definition at line 108 of file features.hpp.

◆ has_sse4_1

bool trlc::platform::FeatureSet::has_sse4_1

SSE4.1 support.

Definition at line 109 of file features.hpp.

◆ has_sse4_2

bool trlc::platform::FeatureSet::has_sse4_2

SSE4.2 support.

Definition at line 110 of file features.hpp.

◆ has_stack_protection

bool trlc::platform::FeatureSet::has_stack_protection

Stack protection enabled.

Definition at line 99 of file features.hpp.

◆ has_thread_sanitizer

bool trlc::platform::FeatureSet::has_thread_sanitizer

ThreadSanitizer enabled.

Definition at line 101 of file features.hpp.

◆ has_threads

bool trlc::platform::FeatureSet::has_threads

Threading support available.

Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/core.hpp.

Definition at line 95 of file features.hpp.

◆ has_undefined_behavior_sanitizer

bool trlc::platform::FeatureSet::has_undefined_behavior_sanitizer

UBSan enabled.

Definition at line 103 of file features.hpp.

◆ has_vector_intrinsics

bool trlc::platform::FeatureSet::has_vector_intrinsics

Vector intrinsics available.

Definition at line 98 of file features.hpp.


The documentation for this struct was generated from the following file: