diff options
author | Adam Mitz <mitza@ociweb.com> | 2015-11-19 11:15:24 -0600 |
---|---|---|
committer | Adam Mitz <mitza@ociweb.com> | 2015-11-19 11:15:24 -0600 |
commit | 984fcc6833d78d6ab53be30d00618786c4c348de (patch) | |
tree | 0c8a1c16e5a87099014d82f55a970718c2295d53 /ACE | |
parent | f2c23532a66ef1deeaeb70c8afc06e38dd083cb2 (diff) | |
download | ATCD-984fcc6833d78d6ab53be30d00618786c4c348de.tar.gz |
Updated fix for SunCC's broken std::allocator.
Diffstat (limited to 'ACE')
-rw-r--r-- | ACE/ace/Array_Map.h | 11 | ||||
-rw-r--r-- | ACE/ace/Array_Map.inl | 8 |
2 files changed, 11 insertions, 8 deletions
diff --git a/ACE/ace/Array_Map.h b/ACE/ace/Array_Map.h index adad5218748..dea7e472685 100644 --- a/ACE/ace/Array_Map.h +++ b/ACE/ace/Array_Map.h @@ -33,6 +33,14 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +#if defined __SUNPRO_CC && !defined _RWSTD_ALLOCATOR +# define ACE_ARRAY_MAP_DEFAULT_ALLOCATOR(K, V) std::allocator_interface< \ + std::allocator<void>, \ + std::pair<K, V> > +#else +# define ACE_ARRAY_MAP_DEFAULT_ALLOCATOR(K, V) std::allocator<std::pair<K, V> > +#endif + /** * @class ACE_Array_Map * @@ -83,7 +91,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * -# Copy constructor * -# operator= */ -template<typename Key, typename Value, class EqualTo = std::equal_to<Key>, class Alloc = std::allocator<std::pair<Key, Value> > > +template<typename Key, typename Value, class EqualTo = std::equal_to<Key>, + class Alloc = ACE_ARRAY_MAP_DEFAULT_ALLOCATOR (Key, Value) > class ACE_Array_Map { public: diff --git a/ACE/ace/Array_Map.inl b/ACE/ace/Array_Map.inl index 0225dc8d5dc..32e7848c02d 100644 --- a/ACE/ace/Array_Map.inl +++ b/ACE/ace/Array_Map.inl @@ -1,19 +1,13 @@ // -*- C++ -*- ACE_BEGIN_VERSIONED_NAMESPACE_DECL -#if defined __SUNPRO_CC && !defined _RWSTD_ALLOCATOR -# define ACE_SUNCC_CAST (pointer) -#else -# define ACE_SUNCC_CAST -#endif - template<typename Key, typename Value, class EqualTo, class Alloc> ACE_INLINE ACE_Array_Map<Key, Value, EqualTo, Alloc>::ACE_Array_Map ( typename ACE_Array_Map<Key, Value, EqualTo, Alloc>::size_type s) : size_ (0) , capacity_ (s) - , nodes_ (s == 0 ? 0 : ACE_SUNCC_CAST this->alloc_.allocate (s)) + , nodes_ (s == 0 ? 0 : this->alloc_.allocate (s)) { std::uninitialized_fill_n (this->nodes_, s, value_type ()); } |