2
0
mirror of https://github.com/boostorg/graph.git synced 2026-01-31 08:12:14 +00:00

Made boost::unordered inclusion unconditional; removed support for non-partial-specialization compilers; enabled C++11 unordered containers when they are present; refs #8962

[SVN r86137]
This commit is contained in:
Jeremiah Willcock
2013-10-02 19:15:21 +00:00
parent da59145176
commit 4fc3cbfaae

View File

@@ -30,6 +30,14 @@
# endif
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET
#include <unordered_set>
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP
#include <unordered_map>
#endif
// The content of this file is in 'graph_detail' because otherwise
// there will be name clashes with
// sandbox/boost/sequence_algo/container_traits.hpp
@@ -280,8 +288,6 @@ namespace boost { namespace graph_detail {
{ };
#ifndef BOOST_NO_HASH
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class Key, class Eq, class Hash, class Alloc>
struct container_traits< boost::unordered_set<Key,Eq,Hash,Alloc> > {
typedef unordered_set_tag category;
@@ -302,7 +308,7 @@ namespace boost { namespace graph_detail {
typedef unordered_multimap_tag category;
typedef unstable_tag iterator_stability;
};
#endif
template <class Key, class Eq, class Hash, class Alloc>
unordered_set_tag
container_category(const boost::unordered_set<Key,Eq,Hash,Alloc>&)
@@ -339,8 +345,87 @@ namespace boost { namespace graph_detail {
unstable_tag
iterator_stability(const boost::unordered_multimap<Key,T,Eq,Hash,Alloc>&)
{ return unstable_tag(); }
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET
template <class Key, class Eq, class Hash, class Alloc>
struct container_traits< std::unordered_set<Key,Eq,Hash,Alloc> > {
typedef unordered_set_tag category;
typedef unstable_tag iterator_stability;
};
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP
template <class Key, class T, class Eq, class Hash, class Alloc>
struct container_traits< std::unordered_map<Key,T,Eq,Hash,Alloc> > {
typedef unordered_map_tag category;
typedef unstable_tag iterator_stability;
};
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET
template <class Key, class Eq, class Hash, class Alloc>
struct container_traits< std::unordered_multiset<Key,Eq,Hash,Alloc> > {
typedef unordered_multiset_tag category;
typedef unstable_tag iterator_stability;
};
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP
template <class Key, class T, class Eq, class Hash, class Alloc>
struct container_traits< std::unordered_multimap<Key,T,Eq,Hash,Alloc> > {
typedef unordered_multimap_tag category;
typedef unstable_tag iterator_stability;
};
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET
template <class Key, class Eq, class Hash, class Alloc>
unordered_set_tag
container_category(const std::unordered_set<Key,Eq,Hash,Alloc>&)
{ return unordered_set_tag(); }
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP
template <class Key, class T, class Eq, class Hash, class Alloc>
unordered_map_tag
container_category(const std::unordered_map<Key,T,Eq,Hash,Alloc>&)
{ return unordered_map_tag(); }
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET
template <class Key, class Eq, class Hash, class Alloc>
unstable_tag iterator_stability(const std::unordered_set<Key,Eq,Hash,Alloc>&)
{ return unstable_tag(); }
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP
template <class Key, class T, class Eq, class Hash, class Alloc>
unstable_tag iterator_stability(const std::unordered_map<Key,T,Eq,Hash,Alloc>&)
{ return unstable_tag(); }
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET
template <class Key, class Eq, class Hash, class Alloc>
unordered_multiset_tag
container_category(const std::unordered_multiset<Key,Eq,Hash,Alloc>&)
{ return unordered_multiset_tag(); }
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP
template <class Key, class T, class Eq, class Hash, class Alloc>
unordered_multimap_tag
container_category(const std::unordered_multimap<Key,T,Eq,Hash,Alloc>&)
{ return unordered_multimap_tag(); }
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_SET
template <class Key, class Eq, class Hash, class Alloc>
unstable_tag
iterator_stability(const std::unordered_multiset<Key,Eq,Hash,Alloc>&)
{ return unstable_tag(); }
#endif
#ifndef BOOST_NO_CXX11_HDR_UNORDERED_MAP
template <class Key, class T, class Eq, class Hash, class Alloc>
unstable_tag
iterator_stability(const std::unordered_multimap<Key,T,Eq,Hash,Alloc>&)
{ return unstable_tag(); }
#endif
//===========================================================================