Is there a way to overload/specialize concepts like templates?
Consider the following pretty simple case where we just want to flag certain Types as 'simple':
// overload/specialization for MyClass - WOULD BE NICE - BUT FAILS
template <typename T>
concept simple = false;
class MyClass;
template <>
concept simple<MyClass> = true;
// workaround, rather verbose - SUCCEEDS
template <typename T>
concept simple = Info<T>::is_simple;
template <typename T>
struct Info
{
static inline constexpr bool is_simple = false;
};
class MyClass;
template <>
struct Info<MyClass>
{
static inline constexpr bool is_simple = true;
};
Is there a simpler way to achieve this?