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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 23 13:33:13 PST 2021


Could add a static_assert in the test to validate that this is the intended
type.

On Tue, Nov 16, 2021 at 5:40 PM Duncan P. N. Exon Smith via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> 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;
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211123/eb772486/attachment.html>


More information about the llvm-commits mailing list