1
0
forked from Alepha/Alepha

Add a repeat function to type lisp.

This commit is contained in:
2024-03-21 16:20:26 -04:00
parent 5242aa340a
commit 5438ae9312

View File

@ -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