forked from Alepha/Alepha
Comparison test builds again.
Now to extend the functionalization.
This commit is contained in:
@ -65,17 +65,17 @@ namespace Alepha::Hydrogen
|
||||
constexpr auto
|
||||
has_cap( const Stud::type_identity< Capabilities< Caps... > > & )
|
||||
{
|
||||
return Meta::find_if< Meta::bind1st< std::is_base_of, cap >, Meta::list< Caps... > >{};
|
||||
return Meta::find_if< Meta::bind1st< std::is_base_of, cap >, Meta::Container::vector< Caps... > >{};
|
||||
}
|
||||
|
||||
template< typename cap >
|
||||
constexpr std::false_type has_cap( const Meta::list<> & ) { return {}; }
|
||||
constexpr std::false_type has_cap( const Meta::Container::vector<> & ) { return {}; }
|
||||
|
||||
template< typename cap, typename First, typename ... TParams >
|
||||
constexpr auto
|
||||
has_cap( const Meta::list< First, TParams... > & )
|
||||
has_cap( const Meta::Container::vector< First, TParams... > & )
|
||||
{
|
||||
using depth_type= decltype( has_cap< cap >( Meta::list< TParams... >{} ) );
|
||||
using depth_type= decltype( has_cap< cap >( Meta::Container::vector< TParams... >{} ) );
|
||||
if constexpr( is_capability_list_v< First > )
|
||||
{
|
||||
using bool_type= decltype( has_cap< cap >( Stud::type_identity< First >() ) );
|
||||
@ -92,7 +92,7 @@ namespace Alepha::Hydrogen
|
||||
constexpr auto
|
||||
has_cap( const Class< TParams... > & )
|
||||
{
|
||||
return has_cap< cap >( Meta::list< TParams... >{} );
|
||||
return has_cap< cap >( Meta::Container::vector< TParams... >{} );
|
||||
}
|
||||
|
||||
namespace exports
|
||||
|
13
Meta/find.h
13
Meta/find.h
@ -6,7 +6,7 @@ static_assert( __cplusplus > 201700, "C++17 Required" );
|
||||
|
||||
#include <tuple>
|
||||
|
||||
#include <Alepha/Meta/list.h>
|
||||
#include <Alepha/Meta/Container/vector.h>
|
||||
#include <Alepha/Meta/functional.h>
|
||||
|
||||
namespace Alepha::Hydrogen::Meta
|
||||
@ -21,11 +21,16 @@ namespace Alepha::Hydrogen::Meta
|
||||
struct find_if;
|
||||
|
||||
template< typename Predicate, typename First, typename ... Elements >
|
||||
struct find_if< Predicate, list< First, Elements... > >
|
||||
: std::conditional_t< Meta::call< Predicate, First >::value, std::true_type, find_if< Predicate, list< Elements... > > >::type {};
|
||||
struct find_if< Predicate, Container::vector< First, Elements... > >
|
||||
: std::conditional_t
|
||||
<
|
||||
Meta::call< Predicate, First >::value,
|
||||
std::true_type,
|
||||
find_if< Predicate, Container::vector< Elements... > >
|
||||
>::type {};
|
||||
|
||||
template< typename Predicate >
|
||||
struct find_if< Predicate, list<> > : std::false_type {};
|
||||
struct find_if< Predicate, Container::vector<> > : std::false_type {};
|
||||
|
||||
template< typename Predicate, typename List >
|
||||
constexpr bool find_if_v= find_if< Predicate, List >::value;
|
||||
|
@ -27,7 +27,7 @@ namespace Alepha::Hydrogen::Meta
|
||||
{
|
||||
using type= bind2nd;
|
||||
template< typename Arg >
|
||||
struct call : Function< Arg, second >::type {};
|
||||
struct call : Function< Arg, Second >::type {};
|
||||
};
|
||||
|
||||
template< typename Function, typename ... Args >
|
||||
|
@ -8,8 +8,8 @@ static_assert( __cplusplus > 201700, "C++17 Required" );
|
||||
|
||||
namespace
|
||||
{
|
||||
using Alepha::Testing::argcnt_t;
|
||||
using Alepha::Testing::argvec_t;
|
||||
using Alepha::exports::types::argcnt_t;
|
||||
using Alepha::exports::types::argvec_t;
|
||||
}
|
||||
|
||||
int
|
||||
|
Reference in New Issue
Block a user