forked from Alepha/Alepha
Some cleanup and tests for Enum and constexpr strings.
This commit is contained in:
13
Enum.h
13
Enum.h
@ -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 &
|
||||
|
Reference in New Issue
Block a user