MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / values

Function values

include/behaviortree_cpp/contrib/magic_enum.hpp:742–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

740
741template <typename E, enum_subtype S, std::size_t Size, int Min>
742constexpr auto values() noexcept {
743 constexpr auto vc = valid_count<E, S, Size, Min>();
744
745 if constexpr (vc.count > 0) {
746#if defined(MAGIC_ENUM_ARRAY_CONSTEXPR)
747 std::array<E, vc.count> values = {};
748#else
749 E values[vc.count] = {};
750#endif
751 for (std::size_t i = 0, v = 0; v < vc.count; ++i) {
752 if (vc.valid[i]) {
753 values[v++] = value<E, Min, S>(i);
754 }
755 }
756#if defined(MAGIC_ENUM_ARRAY_CONSTEXPR)
757 return values;
758#else
759 return to_array(values, std::make_index_sequence<vc.count>{});
760#endif
761 } else {
762 return std::array<E, 0>{};
763 }
764}
765
766template <typename E, enum_subtype S, typename U = std::underlying_type_t<E>>
767constexpr auto values() noexcept {

Callers

nothing calls this directly

Calls 1

to_arrayFunction · 0.85

Tested by

no test coverage detected