#pragma once namespace variant { namespace detail { // Max of a list of values template struct static_max; template struct static_max { static const constexpr size_t value = T; }; template struct static_max { static const constexpr size_t value = T1 > T2 ? static_max::value : static_max::value; }; // Given a typelist of size N, type_index::value will return the inverted // offset (i.e. the number of elements that remain after F in the typelist). template struct type_index; template struct type_index {}; template struct type_index { static const constexpr size_t value = type_index::value; }; template struct type_index { static const constexpr size_t value = sizeof...(Ts); }; }}