Files
qt-creator/tests
Marcus Tillmanns 0e59c9e4e1 Utils: Add "findOr(..., nullopt, ...)" function
findOr(nullopt) returns either a value or a std::nullopt for the first entry
in a container where the predicate returned true.

This makes it easy to write constructs like:

if (auto found = Utils::findOr(container, std::nullopt, [](auto){ ... condition ...}) {
...
}

Change-Id: I6f8f0f9c0d8486c32395123d8c2dcba427887189
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-04 10:24:17 +00:00
..