Modify

Ticket #3868 (closed Bugs: fixed)

Opened 4 years ago

Last modified 2 years ago

bimap build fails without serialization library

Reported by: jdsiiro@… Owned by: matias
Milestone: Boost 1.42.0 Component: bimap
Version: Boost 1.41.0 Severity: Problem
Keywords: Cc:

Description

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 #includes within #ifndefs:

  • detail/set_view_iterator.hpp

     
    1919#include <boost/config.hpp> 
    2020 
    2121// Boost 
    22 #include <boost/serialization/nvp.hpp> 
     22#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION 
     23    #include <boost/serialization/nvp.hpp> 
     24#endif 
    2325#include <boost/iterator/detail/enable_if.hpp> 
    2426#include <boost/iterator/iterator_adaptor.hpp> 
    2527#include <boost/bimap/relation/support/get_pair_functor.hpp> 
  • detail/map_view_iterator.hpp

     
    1919#include <boost/config.hpp> 
    2020 
    2121// Boost 
    22 #include <boost/serialization/nvp.hpp> 
     22#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION 
     23    #include <boost/serialization/nvp.hpp> 
     24#endif 
    2325#include <boost/iterator/detail/enable_if.hpp> 
    2426#include <boost/iterator/iterator_adaptor.hpp> 
    2527#include <boost/bimap/relation/support/pair_by.hpp> 
  • relation/mutant_relation.hpp

     
    2121#include <boost/mpl/vector.hpp> 
    2222#include <boost/operators.hpp> 
    2323#include <boost/call_traits.hpp> 
    24 #include <boost/serialization/nvp.hpp> 
     24#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION 
     25    #include <boost/serialization/nvp.hpp> 
     26#endif 
    2527 
    2628#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:

  • bimap.hpp

     
    5555 
    5656#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION 
    5757    #include <boost/serialization/nvp.hpp> 
     58#else 
     59    #include <boost/throw_exception.hpp> 
    5860#endif // BOOST_BIMAP_DISABLE_SERIALIZATION 
    5961 
    6062// Boost.Bimap 

Attachments

Change History

comment:1 Changed 2 years ago by matias

  • Status changed from new to closed
  • Resolution set to fixed

(In [78154]) [Bimap] Remove spurious dependency on Boost.Serialization (Fix #3868)

comment:2 Changed 2 years ago by matias

(In [78573]) [Bimap] Merge to release ( [78154] Fix #3868, [78159] Fix #5749 )

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.