Adds the possibility to omit the member type in ADAPT_ASSOC* macros usage.

This feature is enabled when BOOST_PP_VARIADICS also is, as it rely on it.
A placeholder for the type can be used when BOOST_PP_VARIADICS isn't
active.
This commit is contained in:
Damien Buhl (alias daminetreg)
2014-07-23 02:42:30 +02:00
parent 17e49ba448
commit 5422ba7f8f
4 changed files with 84 additions and 35 deletions

View File

@ -50,11 +50,21 @@ namespace ns
};
}
BOOST_FUSION_ADAPT_ASSOC_STRUCT(
ns::point,
(int, x, ns::x_member)
(int, y, ns::y_member)
)
#if BOOST_PP_VARIADICS
BOOST_FUSION_ADAPT_ASSOC_STRUCT(
ns::point,
(x, ns::x_member)
(int, y, ns::y_member)
)
#else // BOOST_PP_VARIADICS
BOOST_FUSION_ADAPT_ASSOC_STRUCT(
ns::point,
(BOOST_FUSION_ADAPT_AUTO, x, ns::x_member)
(int, y, ns::y_member)
)
#endif
int
main()