Re: std::get not returning const rvalue reference from const rvalue reference of tuple

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9 May 2018 at 22:10, Tim wrote:
> but I was expecting the last line of output to be "double const&&" because
> the following overload of std::get:
>
> template< std::size_t I, class... Types >
> constexpr std::tuple_element_t<I, tuple<Types...> >const&&
>     get( const tuple<Types...>&& t ) noexcept;
>
> What am I missing here? I'm using gcc 7.3.0 and the above code is compiled
> using "-std=c++17"

The overload you show above was only added to the standard quite
recently, and is not implemented in GCC 7.3 (nobody ever claimed that
C++17 support is complete in GCC 7.3).

It was added by https://cplusplus.github.io/LWG/issue2485

If you use GCC 8.1 you get the result you expect.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux