RFR: 8219816: Add IsArray/RemoveArray type traits utilities
Kim Barrett
kim.barrett at oracle.com
Wed Feb 27 20:21:22 UTC 2019
> On Feb 27, 2019, at 10:08 AM, Kim Barrett <kim.barrett at oracle.com> wrote:
>
>> On Feb 27, 2019, at 3:53 AM, Per Liden <per.liden at oracle.com> wrote:
>>
>> Add IsArray/RemoveArray to our collection of type traits metaprogramming utilities.
>>
>> This patch only adds the IsArray/RemoveArray utilities and their respective tests. A later patch I have in my queue that will actually make use of these.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8219816
>> Webrev: http://cr.openjdk.java.net/~pliden/8219816/webrev.0
>>
>> /Per
>
> For completeness, there should probably be IsArray test cases for
> const/volatile with size.
>
> Otherwise, looks good. I don't need another webrev for those
> additional test cases.
HotSpot's metaprogramming utilities have been intentionally modelled
on those from <type_traits>, both in naming and (with some limitations
in a few cases) behavior. The C++11 type trait for removing array
dimensions from an array type is "remove_extent" (and "remove_all_extents"
to remove all of them from a multi-dimensional array type).
So what this change calls RemoveArray ought to be called RemoveExtent.
Sorry that I forgot to check on this earlier.
More information about the hotspot-dev
mailing list