後でマップに追加するために、次の2行のコードを実行しています。
o.add("-i", 800, "int option");
o.add("-w", "'switch on' option (no third parameter)");
それらを追加するには、次のように定義された2つの追加関数を使用しています。
template<class T>
void add(std::string name, T value, std::string desc);
template<class T>
void add(std::string name, std::string desc);
最初のものは正常に動作し、必要な値を返しますが、2番目のものを追加すると、エラーが発生します。
error: no matching function for call to ‘Opt::add(const char [3], const char [40])’
私の質問は、なぜ最初の文字列が適切に使用されているのか、そして2番目の文字列がconstchar配列として考えられているのかということです。
前もって感謝します。