[libcxx-commits] [PATCH] D118686: [libc++][ranges][NFC] Test the specializations of `tuple_{size, element}` for ranges.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 2 11:01:00 PST 2022


ldionne added a comment.

In D118686#3289137 <https://reviews.llvm.org/D118686#3289137>, @var-const wrote:

> I don't think `generate_header_inclusion_tests.py` can do that because it checks for inclusion of headers, not for the availability of particular classes and functions.

Oh, now that you show me the standard wording, yes I agree with you 100%.

> The existing tests for the similar requirement in `<array>` and `<utility>` do it by instantiating every distinct specialization of `array` and `pair`, respectively (`test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp` and `test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp`). Now that I think about it, it seems like I should move the new tests under `test/std/utilities/tuple/tuple.tuple/tuple.helper`, what do you think?

Yes, that sounds like the correct thing to do.

> Also, would it make sense to instantiate `tuple_size` and `tuple_element` for something other than the range specializations (because if I'm reading the requirement correctly, the templates should become generally available, not just the specializations)?

I'm neutral on this. I think we should aim for the simplest test that gives us confidence that we're doing the right thing. We should avoid getting into diminishing returns IMO.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118686/new/

https://reviews.llvm.org/D118686



More information about the libcxx-commits mailing list