1
0
forked from Alepha/Alepha
Files
Alepha/make_template.h

39 lines
976 B
C++

static_assert( __cplusplus > 2023'00 );
#pragma once
#include <Alepha/Alepha.h>
#include <Alepha/type_lisp.h>
namespace Alepha::Hydrogen ::detail:: make_template_m
{
inline namespace exports {}
template< template< typename ... > class, TypeListType >
struct make_template;
template< template< typename ... > class Template, typename ... Types >
struct make_template< Template, TypeList< Types... > >
{
using type= Template< Types... >;
};
namespace exports
{
/*!
* Bind a type list to a class template which takes a list of arguments.
*
* @tparam Template The class template to instantiate.
* @tparam List The list of types (`Alepha::TypeList< ... >`) to bind.
*/
template< template< typename ... > class Template, TypeListType List >
using make_template_t= typename make_template< Template, List >::type;
};
}
namespace Alepha::Hydrogen::inline exports::inline make_template_m
{
using namespace detail::make_template_m::exports;
}