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