1
0
forked from Alepha/Alepha

Start introducing more requires clauses.

This commit is contained in:
2024-03-21 16:21:08 -04:00
parent c6f86ed4ba
commit d9b2362b54

View File

@ -9,6 +9,9 @@ static_assert( __cplusplus > 2020'99 );
#include <type_traits> #include <type_traits>
#include <Alepha/Concepts.h> #include <Alepha/Concepts.h>
#include <Alepha/type_lisp.h>
#include <Alepha/Meta/tuple_cat.h>
#include <Alepha/Reflection/detail/config.h> #include <Alepha/Reflection/detail/config.h>
@ -77,6 +80,13 @@ namespace Alepha::Hydrogen::Reflection ::detail:: tagged_ctor_arg_m
requires( Concepts::ConstructibleFrom< T, Args... > ) requires( Concepts::ConstructibleFrom< T, Args... > )
constexpr void construct( std::tuple< Args... > && ); constexpr void construct( std::tuple< Args... > && );
template< typename T, typename Tuple >
concept ConstructibleWithTuple=
requires( Tuple tup )
{
{ construct< T >( tup ) };
};
template template
< <
typename T, typename T,
@ -105,6 +115,15 @@ namespace Alepha::Hydrogen::Reflection ::detail:: tagged_ctor_arg_m
typename tag, typename tag,
std::size_t ... positions std::size_t ... positions
> >
requires
(
ConstructibleWithTuple
<
T,
Meta::tuple_cat_t<
tuple_from_list_t< repeat_t< argument< T >, sizeof...( positions ) > >, std::tuple< tag > >
>
)
struct extract_all_ctor_arguments struct extract_all_ctor_arguments
< <
T, T,
@ -123,6 +142,16 @@ namespace Alepha::Hydrogen::Reflection ::detail:: tagged_ctor_arg_m
> >
> >
{ {
static_assert
(
ConstructibleWithTuple
<
T,
Meta::tuple_cat_t<
tuple_from_list_t< repeat_t< argument< T >, sizeof...( positions ) > >, std::tuple< tag > >
>
);
template template
< <
typename int_const, typename int_const,