[Bug libstdc++/70511] tuple constructor from elements hides copy constructor
ivan.lelann at free dot fr
gcc-bugzilla@gcc.gnu.org
Sat Apr 2 07:09:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70511
--- Comment #1 from Ivan Le Lann <ivan.lelann at free dot fr> ---
After a quick look, I'm not sure this can be called a bug.
It looks like a very unfortunate consequence of library specification.
From the mess here
http://en.cppreference.com/w/cpp/utility/tuple/tuple
I understand that
template< class... UTypes > explicit tuple( UTypes&&... args );
is legally selected above copy construction, because it does not add "const".
Just adding "const" to original tuple declaration like this :
const std::tuple<boost::any> tuple_test {val};
makes GCC print intuitive output :
d
d
More information about the Gcc-bugs
mailing list