31 lines
529 B
C++
31 lines
529 B
C++
#ifndef TMP_UTILITY_H
|
|
#define TMP_UTILITY_H
|
|
|
|
#include <type_traits>
|
|
|
|
namespace tmp {
|
|
|
|
using Size = decltype(sizeof 0);
|
|
|
|
using Depth = signed long long int;
|
|
|
|
template<typename T>
|
|
using GetType = typename T::type;
|
|
|
|
namespace detail {
|
|
|
|
template<Depth V, Depth... Vs>
|
|
struct MaxImpl: std::integral_constant<Depth, (V>MaxImpl<Vs...>::value? V:MaxImpl<Vs...>::value)> {};
|
|
|
|
template<Depth V>
|
|
struct MaxImpl<V>: std::integral_constant<decltype(V), V> {};
|
|
|
|
template<Depth... Vs>
|
|
constexpr Depth Max = MaxImpl<Vs...>::value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|