1
0
forked from Alepha/Alepha

Pairs !- tuples, so add some better Meta support

I usually use `tuple` for all product types, but some STL bits
use pair, which is a distinct type.  So here's some helpful
meta helpers for them.
This commit is contained in:
2021-10-15 05:19:09 -04:00
parent 6dcc093af6
commit 525c5b7be8
4 changed files with 139 additions and 0 deletions

33
Meta/is_pair.h Normal file
View File

@ -0,0 +1,33 @@
static_assert( __cplusplus > 201700, "C++17 Required" );
#pragma once
#include <Alepha/Alepha.h>
#include <type_traits>
#include <utility>
namespace Alepha::Hydrogen::Meta
{
inline namespace exports { inline namespace type_traits {} }
namespace detail::type_traits::is_pair
{
inline namespace exports
{
template< typename T >
struct is_pair : std::false_type {};
template< typename ... Args >
struct is_pair< std::pair< Args... > > : std::true_type {};
template< typename T >
constexpr bool is_pair_v= is_pair< T >::value;
}
}
namespace exports::type_traits
{
using namespace detail::type_traits::is_pair::exports;
}
}