forked from Alepha/Alepha
Add list size primitive to type lisp.
This commit is contained in:
15
type_lisp.h
15
type_lisp.h
@ -48,6 +48,21 @@ namespace Alepha::Hydrogen ::detail:: type_lisp_m
|
||||
using type= std::tuple< Members... >;
|
||||
};
|
||||
|
||||
template< TypeListType >
|
||||
struct list_size;
|
||||
|
||||
template< typename ... Members >
|
||||
struct list_size< TypeList< Members... > >
|
||||
{
|
||||
static const std::size_t value= sizeof...( Members );
|
||||
};
|
||||
|
||||
namespace exports
|
||||
{
|
||||
template< TypeListType List >
|
||||
constexpr std::size_t list_size_v= list_size< List >::value;
|
||||
}
|
||||
|
||||
template< typename List >
|
||||
struct car_impl { using type= Nil; };
|
||||
|
||||
|
Reference in New Issue
Block a user