diff --git a/doc/nvp.qbk b/doc/nvp.qbk index 3543a39..0e90e38 100644 --- a/doc/nvp.qbk +++ b/doc/nvp.qbk @@ -50,7 +50,7 @@ public: const T& const_value() const noexcept; template - void serialize(A& archive, unsigned version); + void serialize(A& archive, unsigned); }; template @@ -80,8 +80,7 @@ const nvp make_nvp(const char* name, T& value) noexcept; [Returns a reference to the value.]] [[`const T& const_value() const noexcept;`] [Returns a reference to the value.]] -[[`template void serialize(A& archive, -unsigned version);`] +[[`template void serialize(A& archive, unsigned);`] [Calls `archive.operator<<(const_value())` if `A::is_saving` is a true type, otherwise `archive.operator>>(value())`.]]] diff --git a/include/boost/core/nvp.hpp b/include/boost/core/nvp.hpp index 168e845..a6c2bda 100644 --- a/include/boost/core/nvp.hpp +++ b/include/boost/core/nvp.hpp @@ -19,7 +19,7 @@ struct nvp_bool { typedef bool value_type; typedef nvp_bool type; - BOOST_STATIC_CONSTANT(bool, value = V); + BOOST_STATIC_CONSTEXPR bool value = V; BOOST_CONSTEXPR operator bool() const BOOST_NOEXCEPT { return V; @@ -30,6 +30,9 @@ struct nvp_bool { } }; +template +BOOST_CONSTEXPR_OR_CONST bool nvp_bool::value; + } /* detail */ template diff --git a/test/nvp_test.cpp b/test/nvp_test.cpp index b96cdb0..b87f029 100644 --- a/test/nvp_test.cpp +++ b/test/nvp_test.cpp @@ -76,14 +76,11 @@ void test_deserialize() void test_trait() { - BOOST_TEST_TRAIT_TRUE((boost::is_nvp >)); BOOST_TEST_TRAIT_FALSE((boost::is_nvp)); + BOOST_TEST_TRAIT_TRUE((boost::is_nvp >)); BOOST_TEST_TRAIT_TRUE((boost::is_nvp >)); - BOOST_TEST_TRAIT_FALSE((boost::is_nvp)); BOOST_TEST_TRAIT_TRUE((boost::is_nvp >)); - BOOST_TEST_TRAIT_FALSE((boost::is_nvp)); BOOST_TEST_TRAIT_TRUE((boost::is_nvp >)); - BOOST_TEST_TRAIT_FALSE((boost::is_nvp)); } void test_factory()