mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-23 09:07:26 +02:00
Adds test for each case adapter macros we support to adapt an empty type.
This commit is contained in:
@ -149,6 +149,9 @@ namespace ns
|
||||
|
||||
#endif
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ADT(empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -77,6 +77,10 @@ BOOST_FUSION_ADAPT_ADT_NAMED(
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ADT_NAMED(empty_adt,renamed_empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -70,6 +70,9 @@ BOOST_FUSION_ADAPT_ASSOC_ADT(
|
||||
|
||||
#endif
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT(empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -52,6 +52,9 @@ BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(
|
||||
(int, int, obj.get_y(), obj.set_y(val), ns::y_member)
|
||||
)
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(empty_adt, renamed_empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -71,6 +71,9 @@ namespace ns
|
||||
|
||||
#endif
|
||||
|
||||
struct empty_struct {};
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,);
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -38,6 +38,9 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
|
||||
(int, y, ns::y_member)
|
||||
)
|
||||
|
||||
struct empty_struct {};
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(empty_struct, renamed_empty_struct,);
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -71,6 +71,20 @@ BOOST_FUSION_ADAPT_ASSOC_TPL_ADT(
|
||||
|
||||
#endif
|
||||
|
||||
template <typename TypeToConstruct>
|
||||
class empty_adt_templated_factory {
|
||||
|
||||
TypeToConstruct operator()() {
|
||||
return TypeToConstruct();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
BOOST_FUSION_ADAPT_ASSOC_TPL_ADT(
|
||||
(TypeToConstruct),
|
||||
(empty_adt_templated_factory)(TypeToConstruct),
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -69,6 +69,20 @@ namespace ns
|
||||
)
|
||||
#endif
|
||||
|
||||
template <typename TypeToConstruct>
|
||||
struct empty_struct_templated_factory {
|
||||
|
||||
TypeToConstruct operator()() {
|
||||
return TypeToConstruct();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT(
|
||||
(TypeToConstruct),
|
||||
(empty_struct_templated_factory)(TypeToConstruct),
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ namespace ns
|
||||
#endif
|
||||
|
||||
struct empty_struct {};
|
||||
BOOST_FUSION_ADAPT_STRUCT(empty_struct,);
|
||||
BOOST_FUSION_ADAPT_STRUCT(empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
|
@ -71,6 +71,10 @@ namespace ns
|
||||
|
||||
#endif
|
||||
|
||||
struct empty_struct {};
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED(empty_struct, renamed_empty_struct, )
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(empty_struct, (ns1), renamed_empty_struct1, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -79,6 +79,20 @@ namespace ns
|
||||
)
|
||||
#endif
|
||||
|
||||
template <typename TypeToConstruct>
|
||||
class empty_adt_templated_factory {
|
||||
|
||||
TypeToConstruct operator()() {
|
||||
return TypeToConstruct();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
BOOST_FUSION_ADAPT_TPL_ADT(
|
||||
(TypeToConstruct),
|
||||
(empty_adt_templated_factory)(TypeToConstruct),
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -69,6 +69,19 @@ namespace ns
|
||||
|
||||
#endif
|
||||
|
||||
template <typename TypeToConstruct>
|
||||
struct empty_struct_templated_factory {
|
||||
|
||||
TypeToConstruct operator()() {
|
||||
return TypeToConstruct();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
BOOST_FUSION_ADAPT_TPL_STRUCT(
|
||||
(TypeToConstruct),
|
||||
(empty_struct_templated_factory)(TypeToConstruct),
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
|
Reference in New Issue
Block a user