types/traits: move inner_type to the util namespace

This commit is contained in:
Danny Robson 2018-08-01 17:18:59 +10:00
parent e92f0dc337
commit 00c46e0f9a

View File

@ -349,28 +349,30 @@ template <typename T>
constexpr auto is_contiguous_v = is_contiguous<T>::value;
///////////////////////////////////////////////////////////////////////////////
/// stores the type of '::value_type' for a given type, or the type itself if
/// it does not have such a type.
template <typename ValueT, typename = std::void_t<>>
struct inner_type {
using type = ValueT;
};
namespace util {
///////////////////////////////////////////////////////////////////////////////
/// stores the type of '::value_type' for a given type, or the type itself if
/// it does not have such a type.
template <typename ValueT, typename = std::void_t<>>
struct inner_type {
using type = ValueT;
};
//-----------------------------------------------------------------------------
template <typename ValueT>
struct inner_type<
ValueT,
std::void_t<typename ValueT::value_type>
> {
using type = typename ValueT::value_type;
};
//-----------------------------------------------------------------------------
template <typename ValueT>
struct inner_type<
ValueT,
std::void_t<typename ValueT::value_type>
> {
using type = typename ValueT::value_type;
};
//-----------------------------------------------------------------------------
template <typename ValueT>
using inner_type_t = typename inner_type<ValueT>::type;
//-----------------------------------------------------------------------------
template <typename ValueT>
using inner_type_t = typename inner_type<ValueT>::type;
}
///////////////////////////////////////////////////////////////////////////////