@@ -104,13 +104,16 @@ class heterogeneous_map {
104
104
// we have a value of type int, but request here is std::size_t.
105
105
// Handle that case, by getting T's map of related types, and checking
106
106
// if any of them are valid.
107
- using RelatedTypes =
108
- typename RelatedTypesMap <std::remove_cvref_t <T >>::types;
107
+ using RelatedTypes = typename RelatedTypesMap<
108
+ std:: remove_cv_t <std::remove_reference_t <T> >>::types;
109
109
std::optional<T> opt;
110
110
cudaqx::tuple_for_each (RelatedTypes (), [&](auto &&el) {
111
111
if (!opt.has_value () &&
112
- isCastable<std::remove_cvref_t <decltype (el)>>(iter->second ))
113
- opt = std::any_cast<std::remove_cvref_t <decltype (el)>>(iter->second );
112
+ isCastable<std::remove_cv_t <std::remove_reference_t <decltype (el)>>>(
113
+ iter->second ))
114
+ opt = std::any_cast<
115
+ std::remove_cv_t <std::remove_reference_t <decltype (el)>>>(
116
+ iter->second );
114
117
});
115
118
116
119
if (opt.has_value ())
@@ -185,10 +188,12 @@ class heterogeneous_map {
185
188
// / @brief Check if the map contains a key
186
189
// / @param key The key to check
187
190
// / @return true if the key exists, false otherwise
188
- bool contains (const std::string &key) const { return items.contains (key); }
191
+ bool contains (const std::string &key) const {
192
+ return items.find (key) != items.end ();
193
+ }
189
194
bool contains (const std::vector<std::string> &keys) const {
190
195
for (auto &key : keys)
191
- if (items.contains (key))
196
+ if (items.find (key) != items. end ( ))
192
197
return true ;
193
198
194
199
return false ;
0 commit comments