mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-16 22:02:13 +02:00
Merge branch 'master' into develop
This commit is contained in:
@ -66,7 +66,7 @@
|
|||||||
#define BOOST_FUSION_IGNORE_2(ARG1, ARG2)
|
#define BOOST_FUSION_IGNORE_2(ARG1, ARG2)
|
||||||
|
|
||||||
#define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \
|
#define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \
|
||||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
BOOST_FUSION_GPU_ENABLED \
|
||||||
NAME(BOOST_PP_SEQ_FOR_EACH_I( \
|
NAME(BOOST_PP_SEQ_FOR_EACH_I( \
|
||||||
BOOST_FUSION_MAKE_CONST_REF_PARAM, \
|
BOOST_FUSION_MAKE_CONST_REF_PARAM, \
|
||||||
~, \
|
~, \
|
||||||
@ -337,7 +337,7 @@
|
|||||||
typedef boost::mpl::int_<N> index; \
|
typedef boost::mpl::int_<N> index; \
|
||||||
typedef boost_fusion_detail_Seq sequence_type; \
|
typedef boost_fusion_detail_Seq sequence_type; \
|
||||||
\
|
\
|
||||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
BOOST_FUSION_GPU_ENABLED \
|
||||||
BOOST_FUSION_ITERATOR_NAME(NAME)(boost_fusion_detail_Seq& seq) \
|
BOOST_FUSION_ITERATOR_NAME(NAME)(boost_fusion_detail_Seq& seq) \
|
||||||
: seq_(seq) \
|
: seq_(seq) \
|
||||||
BOOST_FUSION_DEFINE_ITERATOR_WKND_INIT_LIST_ENTRIES( \
|
BOOST_FUSION_DEFINE_ITERATOR_WKND_INIT_LIST_ENTRIES( \
|
||||||
|
@ -67,6 +67,17 @@ namespace ns
|
|||||||
foo foo_;
|
foo foo_;
|
||||||
int y;
|
int y;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Testing non-constexpr compatible types
|
||||||
|
struct employee {
|
||||||
|
std::string name;
|
||||||
|
std::string nickname;
|
||||||
|
|
||||||
|
employee(std::string name, std::string nickname)
|
||||||
|
: name(name), nickname(nickname)
|
||||||
|
{}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOOST_PP_VARIADICS
|
#if BOOST_PP_VARIADICS
|
||||||
@ -96,6 +107,13 @@ namespace ns
|
|||||||
y
|
y
|
||||||
)
|
)
|
||||||
|
|
||||||
|
BOOST_FUSION_ADAPT_STRUCT(
|
||||||
|
ns::employee,
|
||||||
|
name,
|
||||||
|
nickname
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#else // BOOST_PP_VARIADICS
|
#else // BOOST_PP_VARIADICS
|
||||||
|
|
||||||
BOOST_FUSION_ADAPT_STRUCT(
|
BOOST_FUSION_ADAPT_STRUCT(
|
||||||
@ -123,6 +141,12 @@ namespace ns
|
|||||||
(BOOST_FUSION_ADAPT_AUTO, y)
|
(BOOST_FUSION_ADAPT_AUTO, y)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
BOOST_FUSION_ADAPT_STRUCT(
|
||||||
|
ns::employee,
|
||||||
|
(std::string, name)
|
||||||
|
(BOOST_FUSION_ADAPT_AUTO, nickname)
|
||||||
|
)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -224,6 +248,15 @@ main()
|
|||||||
BOOST_TEST(v2 >= v1);
|
BOOST_TEST(v2 >= v1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
ns::employee emp("John Doe", "jdoe");
|
||||||
|
std::cout << at_c<0>(emp) << std::endl;
|
||||||
|
std::cout << at_c<1>(emp) << std::endl;
|
||||||
|
|
||||||
|
fusion::vector<std::string, std::string> v1("John Doe", "jdoe");
|
||||||
|
BOOST_TEST(emp == v1);
|
||||||
|
}
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,14 @@ BOOST_FUSION_DEFINE_STRUCT(
|
|||||||
|
|
||||||
BOOST_FUSION_DEFINE_STRUCT(BOOST_PP_EMPTY(), s, (int, m))
|
BOOST_FUSION_DEFINE_STRUCT(BOOST_PP_EMPTY(), s, (int, m))
|
||||||
|
|
||||||
|
// Testing non-constexpr compatible types
|
||||||
|
BOOST_FUSION_DEFINE_STRUCT(
|
||||||
|
(ns),
|
||||||
|
employee,
|
||||||
|
(std::string, name)
|
||||||
|
(std::string, nickname)
|
||||||
|
)
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
@ -107,5 +115,13 @@ main()
|
|||||||
BOOST_TEST(p == make_vector(3,5));
|
BOOST_TEST(p == make_vector(3,5));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
ns::employee emp = make_list("John Doe", "jdoe");
|
||||||
|
std::cout << at_c<0>(emp) << std::endl;
|
||||||
|
std::cout << at_c<1>(emp) << std::endl;
|
||||||
|
|
||||||
|
BOOST_TEST(emp == make_vector("John Doe", "jdoe"));
|
||||||
|
}
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,13 @@ namespace ns
|
|||||||
BOOST_FUSION_DEFINE_STRUCT_INLINE(s, (int, m))
|
BOOST_FUSION_DEFINE_STRUCT_INLINE(s, (int, m))
|
||||||
|
|
||||||
BOOST_FUSION_DEFINE_STRUCT_INLINE(empty_struct, )
|
BOOST_FUSION_DEFINE_STRUCT_INLINE(empty_struct, )
|
||||||
|
|
||||||
|
// Testing non-constexpr compatible types
|
||||||
|
BOOST_FUSION_DEFINE_STRUCT_INLINE(
|
||||||
|
employee,
|
||||||
|
(std::string, name)
|
||||||
|
(std::string, nickname)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Point>
|
template <typename Point>
|
||||||
@ -128,6 +135,17 @@ main()
|
|||||||
{
|
{
|
||||||
run_test<cls::point>(); // test with non-template enclosing class
|
run_test<cls::point>(); // test with non-template enclosing class
|
||||||
run_test<tpl_cls<>::point>(); // test with template enclosing class
|
run_test<tpl_cls<>::point>(); // test with template enclosing class
|
||||||
|
|
||||||
|
{
|
||||||
|
using namespace boost::fusion;
|
||||||
|
|
||||||
|
ns::employee emp = make_list("John Doe", "jdoe");
|
||||||
|
std::cout << at_c<0>(emp) << std::endl;
|
||||||
|
std::cout << at_c<1>(emp) << std::endl;
|
||||||
|
|
||||||
|
BOOST_TEST(emp == make_vector("John Doe", "jdoe"));
|
||||||
|
}
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user