File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,8 +41,7 @@ namespace ns {
4141
4242 struct guaranteed_nonconstexpr_string {
4343 std::string value;
44- template <typename T>
45- /* explicit*/ guaranteed_nonconstexpr_string(T value) : value(std::move(value)) {
44+ explicit guaranteed_nonconstexpr_string (std::string value) : value(std::move(value)) {
4645 std::cout << " mark to ensure nonconstexpr" << std::endl;
4746 }
4847 };
@@ -145,12 +144,14 @@ main()
145144
146145#if BOOST_PFR_USE_CPP17 != 0
147146 {
148- ns::employee emp{" John Doe" , " jdoe" };
147+ ns::employee emp{guaranteed_nonconstexpr_string (" John Doe" ),
148+ guaranteed_nonconstexpr_string (" jdoe" )};
149149 pfr_fields_view<ns::employee> view (emp);
150150 std::cout << at_c<0 >(view).value << std::endl;
151151 std::cout << at_c<1 >(view).value << std::endl;
152152
153- fusion::vector<ns::guaranteed_nonconstexpr_string, ns::guaranteed_nonconstexpr_string> v1 (" John Doe" , " jdoe" );
153+ fusion::vector<ns::guaranteed_nonconstexpr_string, ns::guaranteed_nonconstexpr_string> v1 (
154+ guaranteed_nonconstexpr_string (" John Doe" ), guaranteed_nonconstexpr_string (" jdoe" ));
154155 BOOST_TEST (view == v1);
155156 }
156157#endif // BOOST_PFR_USE_CPP17
You can’t perform that action at this time.
0 commit comments