Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58062 - trunk/boost/unordered
From: daniel_james_at_[hidden]
Date: 2009-11-30 13:25:26


Author: danieljames
Date: 2009-11-30 13:25:26 EST (Mon, 30 Nov 2009)
New Revision: 58062
URL: http://svn.boost.org/trac/boost/changeset/58062

Log:
Use consistent names for template parameters.

I'm trying to fix the codegear ICEs, but it's hard to tell the cause.
Since the error happens operator== I suspect it's either to do
with defining friend functions with different template names or
something to do with friend functions in general. This is the first stab
in the dark at fixing this.
Text files modified:
   trunk/boost/unordered/unordered_map.hpp | 40 ++++++++++++++++++++--------------------
   trunk/boost/unordered/unordered_map_fwd.hpp | 16 ++++++++--------
   trunk/boost/unordered/unordered_set.hpp | 40 ++++++++++++++++++++--------------------
   trunk/boost/unordered/unordered_set_fwd.hpp | 16 ++++++++--------
   4 files changed, 56 insertions(+), 56 deletions(-)

Modified: trunk/boost/unordered/unordered_map.hpp
==============================================================================
--- trunk/boost/unordered/unordered_map.hpp (original)
+++ trunk/boost/unordered/unordered_map.hpp 2009-11-30 13:25:26 EST (Mon, 30 Nov 2009)
@@ -38,16 +38,16 @@
 
 namespace boost
 {
- template <class Key, class T, class Hash, class Pred, class Alloc>
+ template <class K, class T, class H, class P, class A>
     class unordered_map
     {
     public:
- typedef Key key_type;
- typedef std::pair<const Key, T> value_type;
+ typedef K key_type;
+ typedef std::pair<const K, T> value_type;
         typedef T mapped_type;
- typedef Hash hasher;
- typedef Pred key_equal;
- typedef Alloc allocator_type;
+ typedef H hasher;
+ typedef P key_equal;
+ typedef A allocator_type;
 
 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
     private:
@@ -58,7 +58,7 @@
                 allocator_type, value_type>::type
             value_allocator;
 
- typedef boost::unordered_detail::map<Key, Hash, Pred,
+ typedef boost::unordered_detail::map<K, H, P,
             value_allocator> types;
         typedef BOOST_DEDUCED_TYPENAME types::impl table;
 
@@ -177,7 +177,7 @@
         }
 #else
         unordered_map(boost::unordered_detail::move_from<
- unordered_map<Key, T, Hash, Pred, Alloc>
+ unordered_map<K, T, H, P, A>
> other)
           : table_(other.source.table_, boost::unordered_detail::move_tag())
         {
@@ -513,9 +513,9 @@
         }
         
 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
- friend bool operator==<Key, T, Hash, Pred, Alloc>(
+ friend bool operator==<K, T, H, P, A>(
             unordered_map const&, unordered_map const&);
- friend bool operator!=<Key, T, Hash, Pred, Alloc>(
+ friend bool operator!=<K, T, H, P, A>(
             unordered_map const&, unordered_map const&);
 #endif
     }; // class template unordered_map
@@ -541,17 +541,17 @@
         m1.swap(m2);
     }
 
- template <class Key, class T, class Hash, class Pred, class Alloc>
+ template <class K, class T, class H, class P, class A>
     class unordered_multimap
     {
     public:
 
- typedef Key key_type;
- typedef std::pair<const Key, T> value_type;
+ typedef K key_type;
+ typedef std::pair<const K, T> value_type;
         typedef T mapped_type;
- typedef Hash hasher;
- typedef Pred key_equal;
- typedef Alloc allocator_type;
+ typedef H hasher;
+ typedef P key_equal;
+ typedef A allocator_type;
 
 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
     private:
@@ -562,7 +562,7 @@
                 allocator_type, value_type>::type
             value_allocator;
 
- typedef boost::unordered_detail::multimap<Key, Hash, Pred,
+ typedef boost::unordered_detail::multimap<K, H, P,
             value_allocator> types;
         typedef BOOST_DEDUCED_TYPENAME types::impl table;
 
@@ -682,7 +682,7 @@
         }
 #else
         unordered_multimap(boost::unordered_detail::move_from<
- unordered_multimap<Key, T, Hash, Pred, Alloc>
+ unordered_multimap<K, T, H, P, A>
> other)
           : table_(other.source.table_, boost::unordered_detail::move_tag())
         {
@@ -1002,9 +1002,9 @@
         }
 
 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
- friend bool operator==<Key, T, Hash, Pred, Alloc>(
+ friend bool operator==<K, T, H, P, A>(
             unordered_multimap const&, unordered_multimap const&);
- friend bool operator!=<Key, T, Hash, Pred, Alloc>(
+ friend bool operator!=<K, T, H, P, A>(
             unordered_multimap const&, unordered_multimap const&);
 #endif
     }; // class template unordered_multimap

Modified: trunk/boost/unordered/unordered_map_fwd.hpp
==============================================================================
--- trunk/boost/unordered/unordered_map_fwd.hpp (original)
+++ trunk/boost/unordered/unordered_map_fwd.hpp 2009-11-30 13:25:26 EST (Mon, 30 Nov 2009)
@@ -17,11 +17,11 @@
 
 namespace boost
 {
- template <class Key,
+ template <class K,
         class T,
- class Hash = hash<Key>,
- class Pred = std::equal_to<Key>,
- class Alloc = std::allocator<std::pair<const Key, T> > >
+ class H = hash<K>,
+ class P = std::equal_to<K>,
+ class A = std::allocator<std::pair<const K, T> > >
     class unordered_map;
     template <class K, class T, class H, class P, class A>
     bool operator==(unordered_map<K, T, H, P, A> const&,
@@ -33,11 +33,11 @@
     void swap(unordered_map<K, T, H, P, A>&,
             unordered_map<K, T, H, P, A>&);
 
- template <class Key,
+ template <class K,
         class T,
- class Hash = hash<Key>,
- class Pred = std::equal_to<Key>,
- class Alloc = std::allocator<std::pair<const Key, T> > >
+ class H = hash<K>,
+ class P = std::equal_to<K>,
+ class A = std::allocator<std::pair<const K, T> > >
     class unordered_multimap;
     template <class K, class T, class H, class P, class A>
     bool operator==(unordered_multimap<K, T, H, P, A> const&,

Modified: trunk/boost/unordered/unordered_set.hpp
==============================================================================
--- trunk/boost/unordered/unordered_set.hpp (original)
+++ trunk/boost/unordered/unordered_set.hpp 2009-11-30 13:25:26 EST (Mon, 30 Nov 2009)
@@ -38,16 +38,16 @@
 
 namespace boost
 {
- template <class Value, class Hash, class Pred, class Alloc>
+ template <class T, class H, class P, class A>
     class unordered_set
     {
     public:
 
- typedef Value key_type;
- typedef Value value_type;
- typedef Hash hasher;
- typedef Pred key_equal;
- typedef Alloc allocator_type;
+ typedef T key_type;
+ typedef T value_type;
+ typedef H hasher;
+ typedef P key_equal;
+ typedef A allocator_type;
 
 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
     private:
@@ -58,7 +58,7 @@
                 allocator_type, value_type>::type
             value_allocator;
 
- typedef boost::unordered_detail::set<Hash, Pred,
+ typedef boost::unordered_detail::set<H, P,
             value_allocator> types;
         typedef BOOST_DEDUCED_TYPENAME types::impl table;
 
@@ -171,7 +171,7 @@
         }
 #else
         unordered_set(boost::unordered_detail::move_from<
- unordered_set<Value, Hash, Pred, Alloc>
+ unordered_set<T, H, P, A>
> other)
           : table_(other.source.table_, boost::unordered_detail::move_tag())
         {
@@ -478,9 +478,9 @@
         }
 
 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
- friend bool operator==<Value, Hash, Pred, Alloc>(
+ friend bool operator==<T, H, P, A>(
             unordered_set const&, unordered_set const&);
- friend bool operator!=<Value, Hash, Pred, Alloc>(
+ friend bool operator!=<T, H, P, A>(
             unordered_set const&, unordered_set const&);
 #endif
     }; // class template unordered_set
@@ -506,16 +506,16 @@
         m1.swap(m2);
     }
 
- template <class Value, class Hash, class Pred, class Alloc>
+ template <class T, class H, class P, class A>
     class unordered_multiset
     {
     public:
 
- typedef Value key_type;
- typedef Value value_type;
- typedef Hash hasher;
- typedef Pred key_equal;
- typedef Alloc allocator_type;
+ typedef T key_type;
+ typedef T value_type;
+ typedef H hasher;
+ typedef P key_equal;
+ typedef A allocator_type;
 
 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
     private:
@@ -526,7 +526,7 @@
                 allocator_type, value_type>::type
             value_allocator;
 
- typedef boost::unordered_detail::multiset<Hash, Pred,
+ typedef boost::unordered_detail::multiset<H, P,
             value_allocator> types;
         typedef BOOST_DEDUCED_TYPENAME types::impl table;
 
@@ -640,7 +640,7 @@
         }
 #else
         unordered_multiset(boost::unordered_detail::move_from<
- unordered_multiset<Value, Hash, Pred, Alloc>
+ unordered_multiset<T, H, P, A>
> other)
           : table_(other.source.table_, boost::unordered_detail::move_tag())
         {
@@ -943,9 +943,9 @@
         }
 
 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
- friend bool operator==<Value, Hash, Pred, Alloc>(
+ friend bool operator==<T, H, P, A>(
             unordered_multiset const&, unordered_multiset const&);
- friend bool operator!=<Value, Hash, Pred, Alloc>(
+ friend bool operator!=<T, H, P, A>(
             unordered_multiset const&, unordered_multiset const&);
 #endif
     }; // class template unordered_multiset

Modified: trunk/boost/unordered/unordered_set_fwd.hpp
==============================================================================
--- trunk/boost/unordered/unordered_set_fwd.hpp (original)
+++ trunk/boost/unordered/unordered_set_fwd.hpp 2009-11-30 13:25:26 EST (Mon, 30 Nov 2009)
@@ -17,10 +17,10 @@
 
 namespace boost
 {
- template <class Value,
- class Hash = hash<Value>,
- class Pred = std::equal_to<Value>,
- class Alloc = std::allocator<Value> >
+ template <class T,
+ class H = hash<T>,
+ class P = std::equal_to<T>,
+ class A = std::allocator<T> >
     class unordered_set;
     template <class T, class H, class P, class A>
     bool operator==(unordered_set<T, H, P, A> const&,
@@ -32,10 +32,10 @@
     void swap(unordered_set<T, H, P, A> &m1,
             unordered_set<T, H, P, A> &m2);
 
- template <class Value,
- class Hash = hash<Value>,
- class Pred = std::equal_to<Value>,
- class Alloc = std::allocator<Value> >
+ template <class T,
+ class H = hash<T>,
+ class P = std::equal_to<T>,
+ class A = std::allocator<T> >
     class unordered_multiset;
     template <class T, class H, class P, class A>
     bool operator==(unordered_multiset<T, H, P, A> const&,


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk