Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libs/rteutils/include/CollectionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ auto key_set(const M& m) {
*
* @complexity Linear in the size of the container.
*/
#if defined(__cpp_lib_optional)
template <typename Container, typename Predicate>
auto find_item(Container& c, Predicate pred)
-> std::optional<std::reference_wrapper<typename Container::value_type>>
Expand All @@ -118,6 +119,7 @@ auto find_item(Container& c, Predicate pred)
}
return *it; // reference, not a copy
}
#endif

/**
* @brief string pair
Expand Down
Loading