diff --git a/include/boost/pending/container_traits.hpp b/include/boost/pending/container_traits.hpp index a17d4eb4..bfceee11 100644 --- a/include/boost/pending/container_traits.hpp +++ b/include/boost/pending/container_traits.hpp @@ -59,8 +59,8 @@ namespace boost { // Do mutating operations such as insert/erase/resize invalidate all // outstanding iterators? - struct stable_iterator_tag { }; - struct unstable_iterator_tag { }; + struct stable_tag { }; + struct unstable_tag { }; //====================================================================== // Container Traits Class and container_category() function @@ -74,6 +74,9 @@ namespace boost { }; #endif + // Use this as a compile-time assertion that X is stable + inline void require_stable(stable_tag) { } + // std::vector struct vector_tag : virtual public random_access_container_tag, @@ -84,14 +87,14 @@ namespace boost { { return vector_tag(); } template - unstable_iterator_tag iterator_stability(const std::vector&) - { return unstable_iterator_tag(); } + unstable_tag iterator_stability(const std::vector&) + { return unstable_tag(); } #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct container_traits< std::vector > { typedef vector_tag category; - typedef unstable_iterator_tag iterator_stability; + typedef unstable_tag iterator_stability; }; #endif @@ -108,14 +111,14 @@ namespace boost { { return list_tag(); } template - stable_iterator_tag iterator_stability(const std::list&) - { return stable_iterator_tag(); } + stable_tag iterator_stability(const std::list&) + { return stable_tag(); } #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct container_traits< std::list > { typedef list_tag category; - typedef stable_iterator_tag iterator_stability; + typedef stable_tag iterator_stability; }; #endif @@ -126,7 +129,7 @@ namespace boost { template struct container_traits > { typedef front_insertion_sequence_tag category; - typedef stable_iterator_tag iterator_stability; + typedef stable_tag iterator_stability; }; #endif template @@ -136,9 +139,9 @@ namespace boost { { return front_insertion_sequence_tag(); } template - stable_iterator_tag iterator_stability( + stable_tag iterator_stability( const BOOST_STD_EXTENSION_NAMESPACE::slist&) - { return stable_iterator_tag(); } + { return stable_tag(); } #endif @@ -154,14 +157,14 @@ namespace boost { { return set_tag(); } template - stable_iterator_tag iterator_stability(const std::set&) - { return stable_iterator_tag(); } + stable_tag iterator_stability(const std::set&) + { return stable_tag(); } #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct container_traits< std::set > { typedef set_tag category; - typedef stable_iterator_tag iterator_stability; + typedef stable_tag iterator_stability; }; #endif @@ -177,14 +180,14 @@ namespace boost { { return multiset_tag(); } template - stable_iterator_tag iterator_stability(const std::multiset&) - { return stable_iterator_tag(); } + stable_tag iterator_stability(const std::multiset&) + { return stable_tag(); } #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct container_traits< std::multiset > { typedef multiset_tag category; - typedef stable_iterator_tag iterator_stability; + typedef stable_tag iterator_stability; }; #endif @@ -201,7 +204,7 @@ namespace boost { template struct container_traits< std::map > { typedef map_tag category; - typedef stable_iterator_tag iterator_stability; + typedef stable_tag iterator_stability; }; #endif @@ -210,8 +213,8 @@ namespace boost { { return map_tag(); } template - stable_iterator_tag iterator_stability(const std::map&) - { return stable_iterator_tag(); } + stable_tag iterator_stability(const std::map&) + { return stable_tag(); } // std::multimap struct multimap_tag : @@ -224,7 +227,7 @@ namespace boost { template struct container_traits< std::multimap > { typedef multimap_tag category; - typedef stable_iterator_tag iterator_stability; + typedef stable_tag iterator_stability; }; #endif @@ -233,8 +236,8 @@ namespace boost { { return multimap_tag(); } template - stable_iterator_tag iterator_stability(const std::multimap&) - { return stable_iterator_tag(); } + stable_tag iterator_stability(const std::multimap&) + { return stable_tag(); } // hash_set, hash_map @@ -244,12 +247,12 @@ namespace boost { template struct container_traits< BOOST_STD_EXTENSION_NAMESPACE::hash_set > { typedef set_tag category; - typedef stable_iterator_tag iterator_stability; // is this right? + typedef stable_tag iterator_stability; // is this right? }; template struct container_traits< BOOST_STD_EXTENSION_NAMESPACE::hash_map > { typedef map_tag category; - typedef stable_iterator_tag iterator_stability; // is this right? + typedef stable_tag iterator_stability; // is this right? }; #endif template @@ -261,12 +264,12 @@ namespace boost { { return map_tag(); } template - stable_iterator_tag iterator_stability(const BOOST_STD_EXTENSION_NAMESPACE::hash_set&) - { return stable_iterator_tag(); } + stable_tag iterator_stability(const BOOST_STD_EXTENSION_NAMESPACE::hash_set&) + { return stable_tag(); } template - stable_iterator_tag iterator_stability(const BOOST_STD_EXTENSION_NAMESPACE::hash_map&) - { return stable_iterator_tag(); } + stable_tag iterator_stability(const BOOST_STD_EXTENSION_NAMESPACE::hash_map&) + { return stable_tag(); } #endif @@ -304,7 +307,7 @@ namespace boost { } template void erase_if_dispatch(AssociativeContainer& c, Predicate p, - associative_container_tag, stable_iterator_tag) + associative_container_tag, stable_tag) { typename AssociativeContainer::iterator i, next; for (i = next = c.begin(); next != c.end(); i = next) { @@ -315,7 +318,7 @@ namespace boost { } template void erase_if_dispatch(AssociativeContainer& c, Predicate p, - associative_container_tag, unstable_iterator_tag) + associative_container_tag, unstable_tag) { // This method is really slow, so hopefully we won't have any // associative containers with unstable iterators! diff --git a/include/boost/pending/property.hpp b/include/boost/pending/property.hpp index 17456775..a53e62ca 100644 --- a/include/boost/pending/property.hpp +++ b/include/boost/pending/property.hpp @@ -26,13 +26,14 @@ namespace boost { // property_num, and use enum's for the Property type (see // graph/properties.hpp), but the user may want to use a class // instead with a nested kind type and num. Also, we may want to - // switch BGL back to using class types for properties. + // switch BGL back to using class types for properties at some point. template struct property_kind { typedef typename Property::kind type; }; +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZAATION // The property_num is only needed for no partial spec. workaround // in detail::same_property. @@ -40,6 +41,7 @@ namespace boost { struct property_num { enum { value = Property::num }; }; +#endif } // namespace boost