diff --git a/Meta/tuple_cat.h b/Meta/tuple_cat.h new file mode 100644 index 0000000..79f7079 --- /dev/null +++ b/Meta/tuple_cat.h @@ -0,0 +1,24 @@ +static_assert( __cplusplus > 2020'99 ); + +#pragma once + +#include + +#include + +#include + +namespace Alepha::Hydrogen::Meta ::detail:: tuple_cat_m +{ + inline namespace exports + { + template< typename Left, typename Right > + using tuple_cat_t= tuple_from_list_t< list_cat_t< list_from_tuple_t< Left >, list_from_tuple_t< Right > > >; + } +} + +namespace Alepha::Hydrogen::Meta::inline exports::inline tuple_cat_m +{ + using namespace detail::tuple_cat_m::exports; +} + diff --git a/type_lisp.h b/type_lisp.h index ca2331f..b8e36bd 100644 --- a/type_lisp.h +++ b/type_lisp.h @@ -141,6 +141,27 @@ namespace Alepha::Hydrogen ::detail:: type_lisp_m { using type= TypeList< LeftArgs..., RightArgs... >; }; + + template< typename Item, std::size_t count > + struct repeat; + + namespace exports + { + template< typename Item, std::size_t count > + using repeat_t= typename repeat< Item, count >::type; + } + + template< typename Item, std::size_t count > + struct repeat + { + using type= cons_t< Item, repeat_t< Item, count - 1 > >; + }; + + template< typename Item > + struct repeat< Item, 0 > + { + using type= Nil; + }; } namespace Alepha::Hydrogen::inline exports::inline type_lisp_m