diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-12-21 07:15:15 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-12-21 07:15:15 +0000 |
| commit | 1c7cf88203c8b47cfb008c122ce0f804d80f4e13 (patch) | |
| tree | bed4d11a033da4dd84da3730a8db24367b29852c /include/llvm/ADT/DenseMap.h | |
| parent | 63b0d2edb0a245b325bfab8bdc06416ddc20cf70 (diff) | |
| download | external_llvm-1c7cf88203c8b47cfb008c122ce0f804d80f4e13.zip external_llvm-1c7cf88203c8b47cfb008c122ce0f804d80f4e13.tar.gz external_llvm-1c7cf88203c8b47cfb008c122ce0f804d80f4e13.tar.bz2 | |
add a helper ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/DenseMap.h')
| -rw-r--r-- | include/llvm/ADT/DenseMap.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index 8b62f2d..8b161ea 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -46,7 +46,7 @@ public: typedef ValueT mapped_type; typedef BucketT value_type; - DenseMap(const DenseMap& other) { + DenseMap(const DenseMap &other) { NumBuckets = 0; CopyFrom(other); } @@ -55,6 +55,12 @@ public: init(NumInitBuckets); } + template<typename InputIt> + DenseMap(const InputIt &I, const InputIt &E) { + init(64); + insert(I, E); + } + ~DenseMap() { const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) { |
