私の問題は次のとおりです
template<class T> MyClass
{
MyClass(/* Lots of parameters with no problem */, const T& min = 0, const T& max = std::numeric_limits<T>::max());
set(/* Lots of parameters with no problem */, const T& min = 0, const T& max = std::numeric_limits<T>::max());
/* Lots of function with no problem */
}
std::string
すべての関数を再実装せずに、テンプレートクラスと互換性を持たせたいです。std::stringの場合は必要min = ""
ですmax = ""
。現在、たとえば0を文字列に変換できないため、クラッシュします。どうやってするか ?(コンストラクターとメインセッターのみを専門にできるとしたら、それは素晴らしいことです)。