(I'm learning concepts and templates so correct me if I'm very wrong with something.) I have a function that takes a concept as parameter. I'm now trying to overload this function that takes a more specific concept. That would do "something more specific" or call the less specific function.
template<typename T>
concept Concept1 = ...;
template<typename T>
concept MoreSpecificConcept = ...;
Concept1 <T> &&
...;
//...
void someFunc(const Concept1 auto& x)
{
//do general stuff
}
void someFunc(const MoreSpecificConcept auto& x)
{
if(...)
{
//do specific stuff
}
else
{
//do the more general thing:
// Problem. Trying to call itself:
someFunc(x);
}
}
Is there any way to explicitly tell the compiler which overload to call (like someFunc<Concept1>(x) which doesn't work), or is it solely dependent on the type of the passed object? Lets say that I can't cast x to the more-general type and that the more general function / concept don't know about this more specific function / concept so they can't exclude it with a constraint.
Edit: the functions are meant to be within the same (global) namespace.