@@ -52,24 +52,36 @@ namespace ns {
5252 }
5353
5454 // Testing non-constexpr compatible types
55+ #if BOOST_PFR_USE_CPP17 != 0
5556 struct employee {
5657 guaranteed_nonconstexpr_string name;
5758 guaranteed_nonconstexpr_string nickname;
5859 };
60+ #endif // BOOST_PFR_USE_CPP17
5961}
6062
6163struct s { int m; };
6264
6365int
6466main ()
6567{
66- using namespace boost ::fusion;
67- using namespace boost ;
68+ using boost::fusion::tuple_open;
69+ using boost::fusion::tuple_close;
70+ using boost::fusion::tuple_delimiter;
71+ using boost::fusion::at_c;
72+ using boost::fusion::make_vector;
73+ using boost::fusion::front;
74+ using boost::fusion::back;
75+ using boost::fusion::vector;
76+ using boost::fusion::list;
77+ namespace traits = boost::fusion::traits;
78+ namespace fusion = boost::fusion;
6879 using ns::point;
6980
70- std::cout << tuple_open (' [' );
71- std::cout << tuple_close (' ]' );
72- std::cout << tuple_delimiter (" , " );
81+ // FIXME make this workable even with forced implicit reflection
82+ // std::cout << tuple_open('[');
83+ // std::cout << tuple_close(']');
84+ // std::cout << tuple_delimiter(", ");
7385
7486 {
7587 static_assert (!traits::is_view< point >::value, " " );
7890 std::cout << at_c<0 >(p) << std::endl;
7991 std::cout << at_c<1 >(p) << std::endl;
8092 std::cout << at_c<2 >(p) << std::endl;
81- std::cout << p << std::endl;
93+ boost::fusion::out ( std::cout, p) << std::endl;
8294 BOOST_TEST (p == make_vector (123 , 456 , 789 ));
8395
8496 at_c<0 >(p) = 6 ;
@@ -146,16 +158,18 @@ main()
146158 // , boost::mpl::front<ns::point>::type>::value, "");
147159 }
148160
161+ #if BOOST_PFR_USE_CPP17 != 0
149162 {
150163 ns::employee emp{ns::guaranteed_nonconstexpr_string (" John Doe" ),
151- ns::guaranteed_nonconstexpr_string (" jdoe" )};
164+ ns::guaranteed_nonconstexpr_string (" jdoe" )};
152165 std::cout << at_c<0 >(emp).value << std::endl;
153166 std::cout << at_c<1 >(emp).value << std::endl;
154167
155168 fusion::vector<ns::guaranteed_nonconstexpr_string, ns::guaranteed_nonconstexpr_string> v1 (
156169 ns::guaranteed_nonconstexpr_string (" John Doe" ), ns::guaranteed_nonconstexpr_string (" jdoe" ));
157170 BOOST_TEST (emp == v1);
158171 }
172+ #endif // BOOST_PFR_USE_CPP17
159173
160174 {
161175 int a[3 ] = {100 , 200 , 300 };
0 commit comments