diff --git a/libs/rteutils/include/CollectionUtils.h b/libs/rteutils/include/CollectionUtils.h index 77ffb37a4..445864e1e 100644 --- a/libs/rteutils/include/CollectionUtils.h +++ b/libs/rteutils/include/CollectionUtils.h @@ -108,6 +108,7 @@ auto key_set(const M& m) { * * @complexity Linear in the size of the container. */ +#if defined(__cpp_lib_optional) template auto find_item(Container& c, Predicate pred) -> std::optional> @@ -118,6 +119,7 @@ auto find_item(Container& c, Predicate pred) } return *it; // reference, not a copy } +#endif /** * @brief string pair