I am trying to create a concept to verify that a class has a specific method. The constraint should only check that a method with such name exist and for a specific return type. It should not put constraints on the arguments of the method. It can accept arbitrary number of arguments.
template< typename ExaminedType >
concept ConvertibleToStringObject = requires( ExaminedType instance )
{
{ instance.ToString( ... /* Accept arbitrary number of arguments */ ) } -> SameAs< std::string >;
};
Is it even possible?