File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -697,6 +697,15 @@ void CallOnMembers(Object& object, Callable&& callable)
697697 [&]<auto I>() { callable (Reflection::MemberNameOf<I, Object>, std::get<I>(Reflection::ToTuple (object))); });
698698}
699699
700+ // / Calls a callable on each member of an object with the index of the member as the first argument.
701+ // / and the member's default-constructed value as the second argument.
702+ template <typename Object, typename Callable>
703+ void CallOnMembersWithIndex (Object& object, Callable&& callable)
704+ {
705+ template_for<0 , Reflection::CountMembers<Object>>(
706+ [&]<auto I>() { callable (I, std::get<I>(Reflection::ToTuple (object))); });
707+ }
708+
700709// / Folds over the members of a type without an object of it.
701710// /
702711// / @param initialValue The initial value to fold with
You can’t perform that action at this time.
0 commit comments