This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/70511] tuple constructor from elements hides copy constructor
- From: "ivan.lelann at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 02 Apr 2016 07:08:52 +0000
- Subject: [Bug libstdc++/70511] tuple constructor from elements hides copy constructor
- Auto-submitted: auto-generated
- References: <bug-70511-4 at http dot gcc dot gnu dot org/bugzilla/>
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