forked from OSchip/llvm-project
fix this to work with allocators that have reference type with compilers
that diagnose invalid references to references. llvm-svn: 113078
This commit is contained in:
parent
0963048185
commit
f20ca8028d
|
|
@ -242,6 +242,9 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T> struct ReferenceAdder { typedef T& result; };
|
||||||
|
template <typename T> struct ReferenceAdder<T&> { typedef T result; };
|
||||||
|
|
||||||
/// StringMap - This is an unconventional map that is specialized for handling
|
/// StringMap - This is an unconventional map that is specialized for handling
|
||||||
/// keys that are "strings", which are basically ranges of bytes. This does some
|
/// keys that are "strings", which are basically ranges of bytes. This does some
|
||||||
/// funky memory allocation and hashing things to make it extremely efficient,
|
/// funky memory allocation and hashing things to make it extremely efficient,
|
||||||
|
|
@ -269,9 +272,10 @@ public:
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef typename ReferenceAdder<AllocatorTy>::result AllocatorRefTy;
|
||||||
AllocatorTy &getAllocator() { return Allocator; }
|
typedef typename ReferenceAdder<const AllocatorTy>::result AllocatorCRefTy;
|
||||||
const AllocatorTy &getAllocator() const { return Allocator; }
|
AllocatorRefTy getAllocator() { return Allocator; }
|
||||||
|
AllocatorCRefTy getAllocator() const { return Allocator; }
|
||||||
|
|
||||||
typedef const char* key_type;
|
typedef const char* key_type;
|
||||||
typedef ValueTy mapped_type;
|
typedef ValueTy mapped_type;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue