TRLC Platform Library
1.0.0
Header-only C++ library for compile-time platform detection and abstraction
|
Classes | |
struct | FeatureAvailable |
Type trait to check if a language feature is available. More... | |
struct | AllFeaturesAvailable |
Type trait to check if ALL features are available. More... | |
struct | AnyFeatureAvailable |
Type trait to check if ANY feature is available. More... | |
struct | RuntimeFeatureAvailable |
Type trait for runtime feature availability (non-constexpr) More... | |
Typedefs | |
template<bool B, class T = void> | |
using | enable_if_t = typename std::enable_if< B, T >::type |
template<bool B> | |
using | bool_constant = std::integral_constant< bool, B > |
template<LanguageFeature TFeature> | |
using | enable_if_feature_t = enable_if_t< hasFeature< TFeature >()> |
SFINAE helper to enable template only if feature is available. More... | |
template<LanguageFeature TFeature> | |
using | enable_if_no_feature_t = enable_if_t<!hasFeature< TFeature >()> |
SFINAE helper to enable template only if feature is NOT available. More... | |
template<LanguageFeature... Features> | |
using | enable_if_all_features_t = enable_if_t<(hasFeature< Features >() &&...)> |
SFINAE helper to enable template only if ALL features are available. More... | |
template<LanguageFeature... Features> | |
using | enable_if_any_feature_t = enable_if_t<(hasFeature< Features >()||...)> |
SFINAE helper to enable template only if ANY feature is available. More... | |
Functions | |
template<LanguageFeature... Features> | |
static bool | hasAllFeatures () |
Check if ALL specified features are available. More... | |
template<LanguageFeature... Features> | |
static bool | hasAnyFeature () |
Check if ANY of the specified features are available. More... | |
template<LanguageFeature... Features> | |
static std::size_t | countAvailableFeatures () |
Count how many of the specified features are available. More... | |
template<LanguageFeature TFeature> | |
static bool | getFeatureConstant () |
Get compile-time constant for a language feature. More... | |
Variables | |
template<LanguageFeature TFeature> | |
static bool | feature_available_v = FeatureAvailable<TFeature>::value |
Variable template for FeatureAvailable (C++14+) More... | |
template<LanguageFeature... Features> | |
static bool | all_features_available_v = AllFeaturesAvailable<Features...>::value |
Variable template for AllFeaturesAvailable. More... | |
template<LanguageFeature... Features> | |
static bool | any_feature_available_v = AnyFeatureAvailable<Features...>::value |
Variable template for AnyFeatureAvailable. More... | |
template<LanguageFeature TFeature> | |
static bool | feature_constant_v = getFeatureConstant<TFeature>() |
Template variable for feature constants (C++14+) More... | |
using trlc::platform::traits::bool_constant = typedef std::integral_constant<bool, B> |
Definition at line 165 of file traits.hpp.
using trlc::platform::traits::enable_if_all_features_t = typedef enable_if_t<(hasFeature<Features>() && ...)> |
SFINAE helper to enable template only if ALL features are available.
Features | Variadic LanguageFeatures to check |
Definition at line 198 of file traits.hpp.
using trlc::platform::traits::enable_if_any_feature_t = typedef enable_if_t<(hasFeature<Features>() || ...)> |
SFINAE helper to enable template only if ANY feature is available.
Features | Variadic LanguageFeatures to check |
Definition at line 205 of file traits.hpp.
using trlc::platform::traits::enable_if_feature_t = typedef enable_if_t<hasFeature<TFeature>()> |
SFINAE helper to enable template only if feature is available.
TFeature | LanguageFeature to check |
Definition at line 184 of file traits.hpp.
using trlc::platform::traits::enable_if_no_feature_t = typedef enable_if_t<!hasFeature<TFeature>()> |
SFINAE helper to enable template only if feature is NOT available.
TFeature | LanguageFeature to check |
Definition at line 191 of file traits.hpp.
using trlc::platform::traits::enable_if_t = typedef typename std::enable_if<B, T>::type |
Definition at line 162 of file traits.hpp.
|
static |
Count how many of the specified features are available.
Features | Variadic list of LanguageFeatures |
Definition at line 237 of file traits.hpp.
|
static |
Get compile-time constant for a language feature.
TFeature | LanguageFeature to get constant for |
Definition at line 310 of file traits.hpp.
|
static |
Check if ALL specified features are available.
Features | Variadic list of LanguageFeatures |
Definition at line 217 of file traits.hpp.
|
static |
Check if ANY of the specified features are available.
Features | Variadic list of LanguageFeatures |
Definition at line 227 of file traits.hpp.
|
static |
Variable template for AllFeaturesAvailable.
Features | Variadic LanguageFeatures to check |
Definition at line 271 of file traits.hpp.
|
static |
Variable template for AnyFeatureAvailable.
Features | Variadic LanguageFeatures to check |
Definition at line 285 of file traits.hpp.
|
static |
Variable template for FeatureAvailable (C++14+)
TFeature | LanguageFeature to check |
Definition at line 257 of file traits.hpp.
|
static |
Template variable for feature constants (C++14+)
TFeature | LanguageFeature to check |
Definition at line 319 of file traits.hpp.