[llvm] d00256b - ADT: Adding a key_type definition to MapVector

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 16 17:40:41 PST 2021


Author: Kevin Cadieux
Date: 2021-11-16T17:40:10-08:00
New Revision: d00256bac07e56fe7ccac2b16fb4e52267616e8e

URL: https://github.com/llvm/llvm-project/commit/d00256bac07e56fe7ccac2b16fb4e52267616e8e
DIFF: https://github.com/llvm/llvm-project/commit/d00256bac07e56fe7ccac2b16fb4e52267616e8e.diff

LOG: ADT: Adding a key_type definition to MapVector

The key_type type definition for map containers is useful in some
generic, template-based programming scenarios. The addition of key_type
to MapVector is consistent with other map types like DenseMap.

Differential Revision: https://reviews.llvm.org/D113242

Added: 
    

Modified: 
    llvm/include/llvm/ADT/MapVector.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/MapVector.h b/llvm/include/llvm/ADT/MapVector.h
index 1de1124f4ea24..f9540999381aa 100644
--- a/llvm/include/llvm/ADT/MapVector.h
+++ b/llvm/include/llvm/ADT/MapVector.h
@@ -43,6 +43,7 @@ class MapVector {
       "The mapped_type of the specified Map must be an integral type");
 
 public:
+  using key_type = KeyT;
   using value_type = typename VectorType::value_type;
   using size_type = typename VectorType::size_type;
 


        


More information about the llvm-commits mailing list