forked from Alepha/Alepha
Add a template binding gadget for type lists.
This commit is contained in:
21
make_template.test/0.cc
Normal file
21
make_template.test/0.cc
Normal file
@ -0,0 +1,21 @@
|
||||
static_assert( __cplusplus > 2023'00 );
|
||||
|
||||
#include "../make_template.h"
|
||||
|
||||
#include <tuple>
|
||||
#include <variant>
|
||||
|
||||
namespace
|
||||
{
|
||||
#define ALL_TYPES int, float, char, double, std::nullptr_t, void
|
||||
using MyTypes= Alepha::TypeList
|
||||
<
|
||||
ALL_TYPES
|
||||
>;
|
||||
|
||||
using MyTuple= Alepha::make_template_t< std::tuple, MyTypes >;
|
||||
static_assert( std::is_same_v< MyTuple, std::tuple< ALL_TYPES > > );
|
||||
|
||||
using MyVariant= Alepha::make_template_t< std::variant, MyTypes >;
|
||||
static_assert( std::is_same_v< MyVariant, std::variant< ALL_TYPES > > );
|
||||
}
|
1
make_template.test/CMakeLists.txt
Normal file
1
make_template.test/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
unit_test( 0 )
|
Reference in New Issue
Block a user