09/08/15 00:33:47
演算子のオーバーロードを勉強中です。
コンパイルエラー出ます。本のサンプルプログラムなんですが。
a.c:17: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
string.h:21: note: candidate 1: char& String::operator[](size_t)
a.c:17: note: candidate 2: operator[](char*, int) <built-in>
です。原因は何でしょうか?エラーメッセージがよくわかりません。
もし、ソースコードが必要なら乗せます。