forked from Alepha/Alepha
I think this makes capabilities much simpler and more reliable.
But the capabilities are now limited to a single param -- Time to change that?
This commit is contained in:
@ -28,16 +28,10 @@ namespace Alepha::Hydrogen
|
||||
namespace exports
|
||||
{
|
||||
using detail::comparisons_m::comparable;
|
||||
inline constexpr Meta::type_value< comparable > comparable_capability;
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
constexpr bool has_comparable_capability_v= has_capability( Meta::type_value< std::decay_t< T > >{}, comparable_capability );
|
||||
|
||||
template< typename T >
|
||||
struct has_comparable_capability_s : std::bool_constant< has_comparable_capability_v< T > > {};
|
||||
|
||||
inline constexpr Meta::trait< has_comparable_capability_s > has_comparable_capability;
|
||||
constexpr bool has_comparable_capability_v= HasCapability< std::decay_t< T >, comparable >;
|
||||
|
||||
|
||||
// Spaceship lens support
|
||||
@ -54,7 +48,7 @@ namespace Alepha::Hydrogen
|
||||
template
|
||||
<
|
||||
typename T,
|
||||
typename= std::enable_if_t< has_comparable_capability( Meta::type_value< T >{} ) >,
|
||||
typename= std::enable_if_t< has_comparable_capability_v< T > >,
|
||||
typename= std::enable_if_t< has_spaceship_lens_member_v< T > >,
|
||||
overload< __LINE__ > = nullptr
|
||||
>
|
||||
|
Reference in New Issue
Block a user