BottomTemplate
Metafunction to extract the innermost (bottom) type from nested templates.
Defined in Rodin/Utility/BottomTemplate.h
template < class T> struct BottomTemplate;
Specializations
| Specialization | Description |
|---|---|
T<S>Full specializationtemplate < template< class > class T, class S> struct BottomTemplate< T< S >>; | Specialization for single-parameter template instantiations. |
| Template parameters | |
|---|---|
| T | The type to extract the bottom type from. |
BottomTemplate recursively unwraps template wrappers to find the innermost type. For a non-template type T, the result is T itself. For a nested template like A<B<C<D>>>, the result is D.
Example usage:
using Nested = std::vector<std::optional<int>>; using Bottom = BottomTemplate<Nested>::Type; // Bottom is int (assuming single-param template specialization)
Public types
- using Type = T
- The type itself when T is not a template instantiation.