]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/pfr/test/compile-fail/pfr_review_test2.cpp
1 // Copyright (c) 2020 Antony Polukhin
2 // Copyright (c) 2020 Richard Hodges
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Test case from https://github.com/madmongo1/pfr_review/blob/master/pre-cxx20/test-2.cpp
9 #include <boost/pfr/functions_for.hpp>
11 #include <boost/utility/string_view.hpp>
16 #include <boost/core/lightweight_test.hpp>
21 boost::string_view temperament
;
24 // Error: std::hash not specialized for type
26 // Error: animal is not constexpr initializable
27 BOOST_PFR_FUNCTIONS_FOR(animal
)
28 } // namespace the_wild
30 const auto fido
= the_wild::animal
{ "fido", "aloof" };
33 std::ostringstream oss
;
36 BOOST_TEST_EQ(oss
.str(), "{\"fido\", \"aloof\"}");
38 return boost::report_errors();