Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
transformSTL 関数を使用して、セット内のすべての文字列を小文字に変換しようとしています。しかし、C2664のエラーが発生しました。私のコードの何が問題なのだろうか?
transform
set<string> mydoc; mydoc.insert("ABCD"); transform(mydoc.begin(), mydoc.end(), mydoc.begin(), ::tolower); copy(mydoc.begin(), mydoc.end(), output);
std::string
tolower
set
const
したがって、ソートされたコンテナーにすべての要素を再挿入して時間を無駄にする必要があるため、後で変更するのではなく、に挿入するときにおそらくtolowerそれぞれに適用する必要があります。stringset
string