1
0
forked from Alepha/Alepha

Well this whole () base TMP experiment kinda works.

It's a lot of heavy lifting.  I'm not sure it actually
adds any useful value yet, but I'll continue to play
with it.  It is nice that we can *sometimes* use
loops.  Sometimes we can't though.  And we have
to make some blind-corner evaluations that throw
dummy failures to keep the compiler from complaining
about missing cases -- despite the fact that they;ll
never be reached at compiletime.  (Runtime evaluation
could be different, of course.)

I think, perhaps, a universal representation of a
dereferenced iterator might solve some of this, but
I also don't want to sink too much effort into this,
despite how much fun I'm having.
This commit is contained in:
2021-10-26 01:53:47 -04:00
parent e3d7bbe616
commit cf3f77ba6e
8 changed files with 221 additions and 80 deletions

View File

@ -24,7 +24,13 @@ namespace
using namespace Alepha::exports::comparisons;
using namespace Alepha::exports::capabilities;
template< typename= int, typename= Capabilities< comparable >, typename= float, typename= Capabilities< short > >
template
<
typename= int,
typename= Capabilities< comparable >,
typename= float,
typename= Capabilities< short >
>
struct Date_core
{
int y;
@ -35,7 +41,19 @@ namespace
};
using Date= Date_core<>;
static_assert( Alepha::has_capability_v< Date, comparable > );
namespace detail= Alepha::detail::capabilities;
namespace Meta= Alepha::Meta;
constexpr Meta::Container::vector< short, long, int, int, std::string, std::vector< int >, long, void, void > vec;
constexpr Meta::type_value< int > val;
using std::begin, std::end;
static_assert( Meta::find_if( begin( vec ), end( vec ), Meta::bind1st( Meta::is_same, Meta::type_value< int >{} ) ) );
static_assert( not Meta::find_if( begin( vec ), end( vec ), Meta::bind1st( Meta::is_same, Meta::type_value< double >{} ) ) );
static_assert( detail::is_capability_list_v< Capabilities< comparable > > );
static_assert( Alepha::has_capability( Meta::type_value< Date >{}, comparable_capability ) );
template< template< typename > class op, typename T >
constexpr bool