MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / object_range

Function object_range

src/value.cpp:449–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447const std::shared_ptr<value_base_impl>& value::get_impl() const { return this->x; }
448
449static auto object_range(const std::shared_ptr<value_base_impl>& x)
450{
451 auto* a = if_array_impl(x);
452 assert(a != nullptr);
453 auto* lookup = x->if_object();
454 assert(lookup != nullptr);
455#if defined(__clang_major__) && __clang_major__ > 19
456 std::vector<value> result;
457 std::transform(lookup->begin(),
458 lookup->end(),
459 std::back_inserter(result),
460 [=](const auto& p) -> decltype(auto) { return (*a)[p.second]; });
461 return result;
462#else
463 return views::transform(*lookup,
464 [=](const auto& p) -> decltype(auto) { return (*a)[p.second]; });
465#endif
466}
467
468template <class F>
469static void visit_for_compare(const value& x, F f)

Callers 1

visit_for_compareFunction · 0.85

Calls 5

if_array_implFunction · 0.85
transformFunction · 0.50
if_objectMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected