Как реализовать NOT так, чтобы fn принимал Y, но не X, не создавая при этом несколько концепций и не связывая их в цепочку?
template<class T>
concept Fooable = requires(T t) {
{ t.foo() };
NOT({ t.bar()}); // imaginary syntax
};
struct Y {
void foo() {}
};
struct X {
void foo() {}
void bar() {}
};
template <Fooable T>
void fn(T t) {}





Вы можете использовать NOT с предложением requires, поскольку оно дает bool:
template<class T>
concept Fooable = requires(T t) {
t.foo();
requires (!requires { t.bar(); });
};