[PATCH] D113242: Adding a key_type definition to MapVector

Kevin Cadieux via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 22:00:33 PDT 2021


kevcadieux created this revision.
Herald added a subscriber: dexonsmith.
kevcadieux requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113242

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


Index: llvm/include/llvm/ADT/MapVector.h
===================================================================
--- llvm/include/llvm/ADT/MapVector.h
+++ llvm/include/llvm/ADT/MapVector.h
@@ -43,6 +43,7 @@
       "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;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113242.384966.patch
Type: text/x-patch
Size: 423 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211105/ef48b71d/attachment.bin>


More information about the llvm-commits mailing list