forked from qt-creator/qt-creator
Utils: Remove superfluous qualifications
Change-Id: I36e17dac0cff87f82f0ddaf97bc613389110f218 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Tobias Hunger
parent
9f8dbc1d2f
commit
7cee991c70
@@ -727,15 +727,15 @@ auto toConstReferences(const SourceContainer &sources)
|
||||
/////////////////
|
||||
|
||||
template<class C, typename P>
|
||||
Q_REQUIRED_RESULT Utils::optional<typename C::value_type> take(C &container, P predicate)
|
||||
Q_REQUIRED_RESULT optional<typename C::value_type> take(C &container, P predicate)
|
||||
{
|
||||
const auto end = std::end(container);
|
||||
|
||||
const auto it = std::find_if(std::begin(container), end, predicate);
|
||||
if (it == end)
|
||||
return Utils::nullopt;
|
||||
return nullopt;
|
||||
|
||||
Utils::optional<typename C::value_type> result = Utils::make_optional(std::move(*it));
|
||||
optional<typename C::value_type> result = Utils::make_optional(std::move(*it));
|
||||
container.erase(it);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user