DependentValue
Creates a type-dependent compile-time constant value.
Defined in Rodin/Utility/DependentValue.h
template < class T, T ValueParam, class... Args> struct DependentValue;
| Template parameters | |
|---|---|
| T | The type of the value. |
| ValueParam | The compile-time constant value. |
| Args | Dependent type parameters (unused, but create type dependency). |
DependentValue provides a way to create compile-time constants that depend on template parameters, preventing premature evaluation during template parsing. This is useful in conditional compilation within template contexts.
Example usage:
template <typename T> void foo() { if constexpr (DependentValue<bool, false, T>::Value) { // This branch won't be evaluated unless explicitly instantiated } }
Public static variables
- static bool Value constexpr
- The dependent value.