Skip to content

Commit

Permalink
msg macros: make use of splat's new meta selector
Browse files Browse the repository at this point in the history
  • Loading branch information
iboB committed Jul 26, 2024
1 parent 7575f4f commit 761c95c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions code/dnmx/msg/msg_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,5 @@

#define I_DNMX_MSG_STRUCT_NAME(msg_name) I_DNMX_PP_CAT(msg_name, _msg)

#define I_DNMX_ITERATE_0(MACRO)
#define I_DNMX_ITERATE_1(MACRO, t0) MACRO(t0, 0)
#define I_DNMX_ITERATE_2(MACRO, t0, t1) MACRO(t0, 0), MACRO(t1, 1)
#define I_DNMX_ITERATE_3(MACRO, t0, t1, t2) MACRO(t0, 0), MACRO(t1, 1), MACRO(t2, 2)
#define I_DNMX_ITERATE_4(MACRO, t0, t1, t2, t3) MACRO(t0, 0), MACRO(t1, 1), MACRO(t2, 2), MACRO(t3, 3)

#define I_DNMX_ITERATE_BY(MACRO, ...) SPLAT_SELECT_ARITY_UPTO_5(_, I_DNMX_ITERATE_0, I_DNMX_ITERATE_1, I_DNMX_ITERATE_2, I_DNMX_ITERATE_3, I_DNMX_ITERATE_4, MACRO, ##__VA_ARGS__)

#define I_DNMX_DECL_ARG(t, i) t I_DNMX_PP_CAT(a, i)
#define I_DNMX_DECL_ARGS(...) I_DNMX_ITERATE_BY(I_DNMX_DECL_ARG, ##__VA_ARGS__)
#define I_DNMX_DECL_ARGS(...) SPLAT_ITERATE_WITH(I_DNMX_DECL_ARG, ##__VA_ARGS__)
2 changes: 1 addition & 1 deletion code/dynamix/msg/msg_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#define DYNAMIX_FUNC_TRAITS_NAME(func_name) I_DNMX_PP_CAT(_dynamix_traits_for_, func_name)

#define I_DNMX_FWD_ARG(t, i) std::forward<t>(I_DNMX_PP_CAT(a, i))
#define I_DNMX_FWD_ARGS(...) I_DNMX_ITERATE_BY(I_DNMX_FWD_ARG, ##__VA_ARGS__)
#define I_DNMX_FWD_ARGS(...) SPLAT_ITERATE_WITH(I_DNMX_FWD_ARG, ##__VA_ARGS__)

0 comments on commit 761c95c

Please sign in to comment.