Skip to content

Commit ac422da

Browse files
grasci-armedriouk
andauthored
Ensure RTE library can be used with uVision (C++ 14) (#1414) (#2360)
Co-authored-by: Evgueni Driouk <edriouk@arm.com>
1 parent fcb3bee commit ac422da

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

libs/rteutils/include/CollectionUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ auto key_set(const M& m) {
108108
*
109109
* @complexity Linear in the size of the container.
110110
*/
111+
#if defined(__cpp_lib_optional)
111112
template <typename Container, typename Predicate>
112113
auto find_item(Container& c, Predicate pred)
113114
-> std::optional<std::reference_wrapper<typename Container::value_type>>
@@ -118,6 +119,7 @@ auto find_item(Container& c, Predicate pred)
118119
}
119120
return *it; // reference, not a copy
120121
}
122+
#endif
121123

122124
/**
123125
* @brief string pair

0 commit comments

Comments
 (0)