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 <Alepha/Concepts.h>
#include <Alepha/type_lisp.h>
#include <Alepha/Meta/tuple_cat.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... > )
constexpr void construct( std::tuple< Args... > && );
template< typename T, typename Tuple >
concept ConstructibleWithTuple=
requires( Tuple tup )
{
{ construct< T >( tup ) };
};
template
<
typename T,
@ -105,6 +115,15 @@ namespace Alepha::Hydrogen::Reflection ::detail:: tagged_ctor_arg_m
typename tag,
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
<
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
<
typename int_const,