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.
私は C++ で作業しており、QMap であるオプションのパラメーターを持つ関数を作成したいと考えています。問題は、デフォルト値を何に設定するかです。空のマップにしたい。
void function(int i, QMap< QString, QString > MyMap = ???)
何を入れますか???
QMap (QMap*) へのポインターを使用して、デフォルトとして NULL 値を与えることができます。
void function(int i, QMap< QString, QString > *MyMap = NULL) { }