The similar question can be found here.
I want to pass a null QString
to void foo(const QString &)
. The standard answer is:
foo(QString());
However, can I consider the following as a better replacement in C++11 and later?
foo({});
It's basically a shorter notation, however probably there are some pitfalls or caveats?
Aucun commentaire:
Enregistrer un commentaire