On 2019-05-20 22:18, André Pönitz wrote:
On Fri, May 17, 2019 at 10:17:10AM +0200, Mutz, Marc via Development
wrote:
[...] There is no readability difference between the use of a Qt
container and
that of an STL container.
Exhibit A:
foo().contains(x)
Exhibit B:
{
... container = foo();
std::find(container.begin(), container.end(), x) !=
container.end();
}
And now do the same thing when you look for a given property's value:
[name](auto &e) { return e.name(); }
This is called Selective Perception.
Here's another one:
Exhibit A:
for (auto &[key, value] : map)
use(key, value);
Exhibit B:
for (auto it = map.cbegin(), end = map.cend(); it != end; ++it)
use(it.key(), it.value());
Thanks,
Marc
_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development