diff options
author | Feng Xiao <xiaofeng@google.com> | 2016-06-16 16:19:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-16 16:19:42 -0700 |
commit | 98bd6d753a2b15774c56ecd49763ceb2820d7075 (patch) | |
tree | 8176b0139a9acc5d5f5f23651d299de108b3a719 /src | |
parent | 52598c646ea5621c4fb96f17980f951aac63233c (diff) | |
parent | 6daf3d2c4ae612e46c17df693ea9b0ea04c1f079 (diff) | |
download | protobuf-98bd6d753a2b15774c56ecd49763ceb2820d7075.tar.gz protobuf-98bd6d753a2b15774c56ecd49763ceb2820d7075.tar.bz2 protobuf-98bd6d753a2b15774c56ecd49763ceb2820d7075.zip |
Merge pull request #1692 from vjpai/friendless
Workaround for gcc-4.4 incompatibility
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/map.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 6f1a71e4..31593c1a 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -587,7 +587,7 @@ class Map { explicit MapAllocator(Arena* arena) : arena_(arena) {} template <typename X> MapAllocator(const MapAllocator<X>& allocator) - : arena_(allocator.arena_) {} + : arena_(allocator.arena()) {} pointer allocate(size_type n, const_pointer hint = 0) { // If arena is not given, malloc needs to be called which doesn't @@ -650,12 +650,15 @@ class Map { return std::numeric_limits<size_type>::max(); } + // To support gcc-4.4, which does not properly + // support templated friend classes + Arena* arena() const { + return arena_; + } + private: typedef void DestructorSkippable_; Arena* const arena_; - - template <typename X> - friend class MapAllocator; }; // InnerMap's key type is Key and its value type is value_type*. We use a |