Skip to content

Commit

Permalink
Merge pull request #24 from xenontrioxide/fix-for-pull-request-14
Browse files Browse the repository at this point in the history
Fixes compile error from pull request #14
  • Loading branch information
cbeck88 authored Jun 20, 2022
2 parents 8c91d22 + 0e853f4 commit add1752
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions include/visit_struct/visit_struct_intrusive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,41 @@ static inline ::visit_struct::detail::Append_t<VISIT_STRUCT_GET_REGISTERED_MEMBE
Visit_Struct_Get_Visitables__(::visit_struct::detail::Rank<VISIT_STRUCT_GET_REGISTERED_MEMBERS::size + 1>); \
static_assert(true, "")

#define VISITABLE_INIT(TYPE, NAME, VALUE) \
TYPE NAME = VALUE; \
struct VISIT_STRUCT_MAKE_MEMBER_NAME(NAME) : \
visit_struct::detail::member_ptr_helper<VISIT_STRUCT_CURRENT_TYPE, \
TYPE, \
&VISIT_STRUCT_CURRENT_TYPE::NAME> \
{ \
static VISIT_STRUCT_CONSTEXPR const ::visit_struct::detail::char_array<sizeof(#NAME)> & member_name() { \
return #NAME; \
} \
}; \
static inline ::visit_struct::detail::Append_t<VISIT_STRUCT_GET_REGISTERED_MEMBERS, \
VISIT_STRUCT_MAKE_MEMBER_NAME(NAME)> \
Visit_Struct_Get_Visitables__(::visit_struct::detail::Rank<VISIT_STRUCT_GET_REGISTERED_MEMBERS::size + 1>); \
static_assert(true, "")

#define VISITABLE_DIRECT_INIT(TYPE, NAME, ...) \
TYPE NAME __VA_ARGS__; \
struct VISIT_STRUCT_MAKE_MEMBER_NAME(NAME) : \
visit_struct::detail::member_ptr_helper<VISIT_STRUCT_CURRENT_TYPE, \
TYPE, \
&VISIT_STRUCT_CURRENT_TYPE::NAME> \
{ \
static VISIT_STRUCT_CONSTEXPR const ::visit_struct::detail::char_array<sizeof(#NAME)>& member_name() \
{ \
return #NAME; \
} \
}; \
static inline ::visit_struct::detail::Append_t<VISIT_STRUCT_GET_REGISTERED_MEMBERS, \
VISIT_STRUCT_MAKE_MEMBER_NAME(NAME)> \
Visit_Struct_Get_Visitables__(::visit_struct::detail::Rank<VISIT_STRUCT_GET_REGISTERED_MEMBERS::size + 1>); \
static_assert(true, "")



#define END_VISITABLES \
typedef VISIT_STRUCT_GET_REGISTERED_MEMBERS Visit_Struct_Registered_Members_List__; \
typedef ::visit_struct::detail::intrusive_tag Visit_Struct_Visitable_Structure_Tag__; \
Expand Down

0 comments on commit add1752

Please sign in to comment.