This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/69354] std::thread doesn't support move-only callable objects
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 19 Jan 2016 12:46:25 +0000
- Subject: [Bug libstdc++/69354] std::thread doesn't support move-only callable objects
- Auto-submitted: auto-generated
- References: <bug-69354-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69354
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Anthony Williams from comment #3)
> I hadn't noticed I had omitted the const!
It took me a while to spot it too!
> Surely the intent of 12.8p11.2 is that if you can't actually copy the bases
> and/or members with the specified signature then the defaulted copy
> constructor is deleted?
One would think so, yes.
> Are you going to file the DR or shall I?
I'll do so.
> Potential core defect aside, I still think this class should work with
> std::thread, as it fits the MoveConstructible requirement.
Yes, I tried to find a way to declare this INVALID but couldn't find one :-)
The fact we use std::tuple in std::thread is purely an implementation detail
and any limitation in our tuple shouldn't prevent valid uses of std::thread.