Subject: [Boost-bugs] [Boost C++ Libraries] #3868: bimap build fails without serialization library
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-01-27 23:58:38
#3868: bimap build fails without serialization library
--------------------------------+-------------------------------------------
Reporter: jdsiiro@⦠| Owner: matias
Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: bimap
Version: Boost 1.41.0 | Severity: Problem
Keywords: |
--------------------------------+-------------------------------------------
Builds including Bimap fail unless the Serialization library is present
(even when defining `BOOST_BIMAP_DISABLE_SERIALIZATION`). This is caused
by a reference to a missing header file (`boost/serialization/nvp.hpp`).
A fix appears to be to guard those `#include`s within `#ifndef`s:
{{{
#!diff
Index: detail/set_view_iterator.hpp
===================================================================
--- detail/set_view_iterator.hpp (revision 2317)
+++ detail/set_view_iterator.hpp (working copy)
@@ -19,7 +19,9 @@
#include <boost/config.hpp>
// Boost
-#include <boost/serialization/nvp.hpp>
+#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION
+ #include <boost/serialization/nvp.hpp>
+#endif
#include <boost/iterator/detail/enable_if.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/bimap/relation/support/get_pair_functor.hpp>
Index: detail/map_view_iterator.hpp
===================================================================
--- detail/map_view_iterator.hpp (revision 2317)
+++ detail/map_view_iterator.hpp (working copy)
@@ -19,7 +19,9 @@
#include <boost/config.hpp>
// Boost
-#include <boost/serialization/nvp.hpp>
+#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION
+ #include <boost/serialization/nvp.hpp>
+#endif
#include <boost/iterator/detail/enable_if.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/bimap/relation/support/pair_by.hpp>
Index: relation/mutant_relation.hpp
===================================================================
--- relation/mutant_relation.hpp (revision 2317)
+++ relation/mutant_relation.hpp (working copy)
@@ -21,7 +21,9 @@
#include <boost/mpl/vector.hpp>
#include <boost/operators.hpp>
#include <boost/call_traits.hpp>
-#include <boost/serialization/nvp.hpp>
+#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION
+ #include <boost/serialization/nvp.hpp>
+#endif
#include <boost/functional/hash/hash.hpp>
}}}
In addition, this exposes a missing dependence on
`boost/throw_exception.hpp` that can be resolved (albeit, non-ideally)
through the following:
{{{
#!diff
Index: bimap.hpp
===================================================================
--- bimap.hpp (revision 2317)
+++ bimap.hpp (working copy)
@@ -55,6 +55,8 @@
#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION
#include <boost/serialization/nvp.hpp>
+#else
+ #include <boost/throw_exception.hpp>
#endif // BOOST_BIMAP_DISABLE_SERIALIZATION
// Boost.Bimap
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3868> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC