1
0
forked from Alepha/Alepha

Starting out Alepha from scratch, as a C++17 effort.

This one is going to be prepped for GitHub private, from the get
go.  This initial commit has some evaluation helpers and the
unit testing infrastructure.  `TableTest` will come next.
This commit is contained in:
2021-07-01 01:42:11 -04:00
commit 7ceef7e1b1
6 changed files with 253 additions and 0 deletions

48
Utility/evaluation.h Normal file
View File

@ -0,0 +1,48 @@
static_assert( __cplusplus > 201700, "C++17 Required" );
#pragma once
#include <Alepha/Alepha.h>
#include <tuple>
#include <utility>
namespace Alepha::Hydrogen::Utility
{
inline namespace exports { inline namespace evaluation {} }
namespace detail::evaluation
{
struct evaluate_t {};
struct enroll_t {};
inline namespace exports
{
inline constexpr evaluate_t evaluate;
inline constexpr enroll_t enroll;
}
template< typename Function >
decltype( auto )
operator <=( evaluate_t, Function &&init )
{
return std::forward< Function >( init )();
}
template< typename Init >
auto
operator <=( enroll_t, Init init )
{
struct {} registration;
(void) ( evaluate <=init );
return registration;
}
}
namespace exports::evaluation
{
using namespace detail::evaluation::exports;
}
}