diff options
Diffstat (limited to 'boost/bimap/relation/mutant_relation.hpp')
-rw-r--r-- | boost/bimap/relation/mutant_relation.hpp | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/boost/bimap/relation/mutant_relation.hpp b/boost/bimap/relation/mutant_relation.hpp index 9aa28e4cac..60294a3b60 100644 --- a/boost/bimap/relation/mutant_relation.hpp +++ b/boost/bimap/relation/mutant_relation.hpp @@ -142,7 +142,7 @@ class relation_info_hook : public #ifndef BOOST_BIMAP_DISABLE_SERIALIZATION template< class Archive > - void serialize(Archive & ar, const unsigned int version) + void serialize(Archive & ar, const unsigned int) { ar & ::boost::serialization::make_nvp("left" , base_::left ); ar & ::boost::serialization::make_nvp("right", base_::right); @@ -188,7 +188,7 @@ class relation_info_hook<TA,TB,::boost::mpl::na,force_mutable> : #ifndef BOOST_BIMAP_DISABLE_SERIALIZATION template< class Archive > - void serialize(Archive & ar, const unsigned int version) + void serialize(Archive & ar, const unsigned int) { ar & ::boost::serialization::make_nvp("left" , base_::left ); ar & ::boost::serialization::make_nvp("right", base_::right); @@ -346,7 +346,7 @@ class mutant_relation : public { return ::boost::bimaps::relation::support::get<Tag>(*this); } - + #ifndef BOOST_BIMAP_DISABLE_SERIALIZATION private: @@ -422,6 +422,50 @@ bool operator>=(const detail::relation_storage<FirstType,SecondType,FM1> & a, (( a.left == b.left ) && ( a.right >= b.right ))); } +namespace detail { + +template< class TA, class TB, class Info, bool force_mutable> +mutant_relation<TA,TB,Info,force_mutable> + copy_with_left_replaced(mutant_relation<TA,TB,Info,force_mutable> const& rel, + BOOST_DEDUCED_TYPENAME ::boost::call_traits< BOOST_DEDUCED_TYPENAME + mutant_relation<TA,TB,Info,force_mutable>::left_value_type> + ::param_type l) +{ + return mutant_relation<TA,TB,Info,force_mutable>(l,rel.right,rel.info); +} + +template< class TA, class TB, bool force_mutable> +mutant_relation<TA,TB,::boost::mpl::na,force_mutable> + copy_with_left_replaced(mutant_relation<TA,TB,::boost::mpl::na,force_mutable> const& rel, + BOOST_DEDUCED_TYPENAME ::boost::call_traits< BOOST_DEDUCED_TYPENAME + mutant_relation<TA,TB,::boost::mpl::na,force_mutable>::left_value_type> + ::param_type l) +{ + return mutant_relation<TA,TB,::boost::mpl::na,force_mutable>(l,rel.right); +} + +template< class TA, class TB, class Info, bool force_mutable> +mutant_relation<TA,TB,Info,force_mutable> + copy_with_right_replaced(mutant_relation<TA,TB,Info,force_mutable> const& rel, + BOOST_DEDUCED_TYPENAME ::boost::call_traits< BOOST_DEDUCED_TYPENAME + mutant_relation<TA,TB,Info,force_mutable>::right_value_type> + ::param_type r) +{ + return mutant_relation<TA,TB,Info,force_mutable>(rel.left,r,rel.info); +} + +template< class TA, class TB, bool force_mutable> +mutant_relation<TA,TB,::boost::mpl::na,force_mutable> + copy_with_right_replaced(mutant_relation<TA,TB,::boost::mpl::na,force_mutable> const& rel, + BOOST_DEDUCED_TYPENAME ::boost::call_traits< BOOST_DEDUCED_TYPENAME + mutant_relation<TA,TB,::boost::mpl::na,force_mutable>::right_value_type> + ::param_type r) +{ + return mutant_relation<TA,TB,::boost::mpl::na,force_mutable>(rel.left,r); +} + +} // namespace detail + } // namespace relation } // namespace bimaps } // namespace boost |