mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-16 05:42:20 +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
|
#endif
|
||||||
|
|
||||||
|
class empty_adt{};
|
||||||
|
BOOST_FUSION_ADAPT_ADT(empty_adt,)
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -77,6 +77,10 @@ BOOST_FUSION_ADAPT_ADT_NAMED(
|
|||||||
|
|
||||||
#endif // BOOST_PP_VARIADICS
|
#endif // BOOST_PP_VARIADICS
|
||||||
|
|
||||||
|
|
||||||
|
class empty_adt{};
|
||||||
|
BOOST_FUSION_ADAPT_ADT_NAMED(empty_adt,renamed_empty_adt,)
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -70,6 +70,9 @@ BOOST_FUSION_ADAPT_ASSOC_ADT(
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class empty_adt{};
|
||||||
|
BOOST_FUSION_ADAPT_ASSOC_ADT(empty_adt,)
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -52,6 +52,9 @@ BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(
|
|||||||
(int, int, obj.get_y(), obj.set_y(val), ns::y_member)
|
(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
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -71,6 +71,9 @@ namespace ns
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct empty_struct {};
|
||||||
|
BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,);
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -38,6 +38,9 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
|
|||||||
(int, y, ns::y_member)
|
(int, y, ns::y_member)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
struct empty_struct {};
|
||||||
|
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(empty_struct, renamed_empty_struct,);
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -71,6 +71,20 @@ BOOST_FUSION_ADAPT_ASSOC_TPL_ADT(
|
|||||||
|
|
||||||
#endif
|
#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
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -69,6 +69,20 @@ namespace ns
|
|||||||
)
|
)
|
||||||
#endif
|
#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
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -150,7 +150,7 @@ namespace ns
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct empty_struct {};
|
struct empty_struct {};
|
||||||
BOOST_FUSION_ADAPT_STRUCT(empty_struct,);
|
BOOST_FUSION_ADAPT_STRUCT(empty_struct,)
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
|
@ -71,6 +71,10 @@ namespace ns
|
|||||||
|
|
||||||
#endif
|
#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
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -79,6 +79,20 @@ namespace ns
|
|||||||
)
|
)
|
||||||
#endif
|
#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
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
@ -69,6 +69,19 @@ namespace ns
|
|||||||
|
|
||||||
#endif
|
#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
|
int
|
||||||
main()
|
main()
|
||||||
|
Reference in New Issue
Block a user