Skip to content

Commit

Permalink
Remove redundant macro ___PRO_DEF_BRACKETS_OP_ACCESSOR (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxwa authored Aug 2, 2024
1 parent 09fbd80 commit 0326a38
Showing 1 changed file with 20 additions and 29 deletions.
49 changes: 20 additions & 29 deletions proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -1413,39 +1413,13 @@ ___PRO_ASSIGNMENT_OP_DISPATCH_IMPL(>>=)
___PRO_BINARY_OP_DISPATCH_IMPL(,)
___PRO_BINARY_OP_DISPATCH_IMPL(->*)

#undef ___PRO_ASSIGNMENT_OP_DISPATCH_IMPL
#undef ___PRO_DEF_RHS_ASSIGNMENT_OP_ACCESSOR
#undef ___PRO_DEF_LHS_ASSIGNMENT_OP_ACCESSOR
#undef ___PRO_BINARY_OP_DISPATCH_IMPL
#undef ___PRO_EXTENDED_BINARY_OP_DISPATCH_IMPL
#undef ___PRO_RHS_OP_DISPATCH_IMPL
#undef ___PRO_DEF_RHS_OP_ACCESSOR
#undef ___PRO_LHS_OP_DISPATCH_IMPL
#undef ___PRO_LHS_ALL_OP_DISPATCH_BODY_IMPL
#undef ___PRO_LHS_BINARY_OP_DISPATCH_BODY_IMPL
#undef ___PRO_LHS_UNARY_OP_DISPATCH_BODY_IMPL
#undef ___PRO_LHS_LEFT_OP_DISPATCH_BODY_IMPL
#undef ___PRO_DEF_LHS_ALL_OP_ACCESSOR
#undef ___PRO_DEF_LHS_BINARY_OP_ACCESSOR
#undef ___PRO_DEF_LHS_UNARY_OP_ACCESSOR
#undef ___PRO_DEF_LHS_ANY_OP_ACCESSOR
#undef ___PRO_DEF_LHS_LEFT_OP_ACCESSOR

#define ___PRO_DEF_BRACKETS_OP_ACCESSOR(Q, SELF, ...) \
template <class F, class C, class R, class... Args> \
struct accessor<F, C, R(Args...) Q> { \
R __VA_ARGS__ (Args... args) Q { \
return proxy_invoke<C>(access_proxy<F>(SELF), \
std::forward<Args>(args)...); \
} \
}
template <>
struct operator_dispatch<"()", false> {
template <class T, class... Args>
decltype(auto) operator()(T&& self, Args&&... args)
___PRO_DIRECT_FUNC_IMPL(
std::forward<T>(self)(std::forward<Args>(args)...))
___PRO_DEF_MEM_ACCESSOR_TEMPLATE(___PRO_DEF_BRACKETS_OP_ACCESSOR, operator())
___PRO_DEF_MEM_ACCESSOR_TEMPLATE(___PRO_DEF_LHS_ANY_OP_ACCESSOR, operator())
};
template <>
struct operator_dispatch<"[]", false> {
Expand All @@ -1459,9 +1433,26 @@ struct operator_dispatch<"[]", false> {
decltype(auto) operator()(T&& self, Arg&& arg)
___PRO_DIRECT_FUNC_IMPL(std::forward<T>(self)[std::forward<Arg>(arg)])
#endif // defined(__cpp_multidimensional_subscript) && __cpp_multidimensional_subscript >= 202110L
___PRO_DEF_MEM_ACCESSOR_TEMPLATE(___PRO_DEF_BRACKETS_OP_ACCESSOR, operator[])
___PRO_DEF_MEM_ACCESSOR_TEMPLATE(___PRO_DEF_LHS_ANY_OP_ACCESSOR, operator[])
};
#undef ___PRO_DEF_BRACKETS_OP_ACCESSOR

#undef ___PRO_ASSIGNMENT_OP_DISPATCH_IMPL
#undef ___PRO_DEF_RHS_ASSIGNMENT_OP_ACCESSOR
#undef ___PRO_DEF_LHS_ASSIGNMENT_OP_ACCESSOR
#undef ___PRO_BINARY_OP_DISPATCH_IMPL
#undef ___PRO_EXTENDED_BINARY_OP_DISPATCH_IMPL
#undef ___PRO_RHS_OP_DISPATCH_IMPL
#undef ___PRO_DEF_RHS_OP_ACCESSOR
#undef ___PRO_LHS_OP_DISPATCH_IMPL
#undef ___PRO_LHS_ALL_OP_DISPATCH_BODY_IMPL
#undef ___PRO_LHS_BINARY_OP_DISPATCH_BODY_IMPL
#undef ___PRO_LHS_UNARY_OP_DISPATCH_BODY_IMPL
#undef ___PRO_LHS_LEFT_OP_DISPATCH_BODY_IMPL
#undef ___PRO_DEF_LHS_ALL_OP_ACCESSOR
#undef ___PRO_DEF_LHS_BINARY_OP_ACCESSOR
#undef ___PRO_DEF_LHS_UNARY_OP_ACCESSOR
#undef ___PRO_DEF_LHS_ANY_OP_ACCESSOR
#undef ___PRO_DEF_LHS_LEFT_OP_ACCESSOR

#define ___PRO_DEF_CONVERSION_ACCESSOR(Q, SELF, ...) \
template <class F, class C> \
Expand Down

0 comments on commit 0326a38

Please sign in to comment.