1
0
forked from Alepha/Alepha

Some cleanup and tests for Enum and constexpr strings.

This commit is contained in:
2024-04-04 00:53:12 -04:00
parent 38df35ebc4
commit 29575e7e30
5 changed files with 70 additions and 13 deletions

13
Enum.h
View File

@ -19,7 +19,7 @@ static_assert( __cplusplus > 2020'99 );
#include "ConstexprString.h"
#include "meta.h"
namespace Alepha::Hydrogen ::detail:: Enum_m
namespace Alepha::Hydrogen ::detail:: Enum_m
{
inline namespace exports {}
@ -52,13 +52,6 @@ namespace Alepha::Hydrogen ::detail:: Enum_m
}
}
template< auto value, auto ... >
constexpr decltype( auto )
get_first_enum_string()
{
return value;
}
template< ConstexprString s >
struct EnumValueString
{
@ -121,8 +114,6 @@ namespace Alepha::Hydrogen ::detail:: Enum_m
template< EnumValueString ... values >
class exports::Enum
//: private comparable
// Alepha::Hydrogen comparables work differently than the one-off Cavorite form.
{
private:
enum class StrictInteger : unsigned {};
@ -197,8 +188,6 @@ namespace Alepha::Hydrogen ::detail:: Enum_m
constexpr unsigned get_index() const { return static_cast< unsigned >( value ); }
constexpr auto equality_lens() const { return value; }
bool operator == ( const Enum & ) const= default;
friend std::ostream &