I would like to know what are the main differences between the following methods. Is there a case were one of the two would cause problems if std::to_string
is defined?
include <string>
using namespace std;
enum class eColor
{
Red
};
void to_string(eColor color)
{
}
template<typename C = eColor)
void to_string(C color)
{
}
int main()
{
to_string(eColor::Red); // assume only one of the above is defined
return 0;
}
Is there a case where one of the above should be preferred?