I would like to have a concept for the
struct creatorclass {
template<typename T>
int fct(T val)
{
return 42;
}
};
What I would like is a concept that checks for the existence of a function fct without specifying the template parameter. That is want to have
template<typename U>
concept CREATOR=requires(U val) {
val.fct;
};
I think that this is not possible since a concept needs to be evaluated and so compiled. This cannot be done without knowing the class T. Am I correct?
Note: Specifying a concept for a type that has a member function template using Concepts Lite also says this is not possible but this is for concept-lite six years ago before the C++20 standard.