I don't know if it is a bug, because the standard does not specify whether make_from_tuple can be applied to subrange even if it looks well-formed, so this may only be regarded as a feature request. Given that MSVC-STL already supports it, I think it should have some value. #include <ranges> #include <vector> int main() { auto v = std::make_from_tuple<std::vector<int>>(std::ranges::subrange(std::views::iota(0, 5))); } https://godbolt.org/z/Ebx83z4s1
Even LLVM's libc++ does not support this ...
(In reply to Andrew Pinski from comment #1) > Even LLVM's libc++ does not support this ... I think you are right, but I want to know what libstdc++ thinks about this issue.
(In reply to Andrew Pinski from comment #1) > Even LLVM's libc++ does not support this ... Does libc++ even define subrange yet? It looks like we don't define the tuple_size and tuple_element specializations for subrange, probably because I didn't realise they were needed.
Oh no, Patrick added them in r10-6508, and after PR 97512 it should work. Hmm.
(In reply to Jonathan Wakely from comment #4) > Oh no, Patrick added them in r10-6508, and after PR 97512 it should work. > Hmm. I think it should not work because make_from_tuple uses std::get inside and is defined before using ranges::get, this will cause some namespace and ADL mechanisms to prevent it from being selected.
Ugh, std::get is such a fragile and horrible API.
(In reply to Jonathan Wakely from comment #6) > Ugh, std::get is such a fragile and horrible API. Agreed, BTW PR 97512 was the first libstdc++ bug I reported, thank you for letting me back to the old days.
I've submitted an LWG issue for this. BTW, it's unfortunate that the standard library has both tuple-like and variant-like std::get overloads, and they are not clearly distinguished in the specification...
https://cplusplus.github.io/LWG/issue3690
GCC 10.4 is being released, retargeting bugs to GCC 10.5.