| 260 | |
| 261 | template <class T> |
| 262 | static T* find_impl(const std::shared_ptr<value_base_impl>& x, const std::string& key, T* end) |
| 263 | { |
| 264 | auto* a = if_array_impl(x); |
| 265 | if(a == nullptr) |
| 266 | return end; |
| 267 | auto* lookup = x->if_object(); |
| 268 | if(lookup == nullptr) |
| 269 | return end; |
| 270 | auto it = lookup->find(key); |
| 271 | if(it == lookup->end()) |
| 272 | return end; |
| 273 | return std::addressof((*a)[it->second]); |
| 274 | } |
| 275 | |
| 276 | value* value::find(const std::string& pkey) { return find_impl(x, pkey, this->end()); } |
| 277 |
no test coverage detected