From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AED163857829; Fri, 1 Oct 2021 19:40:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AED163857829 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100612] std::jthread can't be initialized with a pointer to a member function taking a std::stop_token Date: Fri, 01 Oct 2021 19:40:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 19:40:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100612 --- Comment #10 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:34e9407b3b4298bd587e0df2e0047679019b66cf commit r12-4081-g34e9407b3b4298bd587e0df2e0047679019b66cf Author: Jonathan Wakely Date: Thu May 20 22:36:16 2021 +0100 libstdc++: Make std::jthread support pointers to member functions [PR 100612] This adds a non-standard extension to support initializing a std::jthread with a pointer to a member function that expects a stop_token to be added to the arguments. That use case is not supported by C++20, because the stop_token would get added as the first argument, which is where the object argument needs to be to invoke a pointer to member function. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/100612 * include/std/thread (__pmf_expects_stop_token): New variable template to detect a pointer to member function that needs a stop_token to be added to the arguments. (jthread::__S_create): Use __pmf_expects_stop_token. (jthread::__S_create_pmf): New function. * testsuite/30_threads/jthread/100612.cc: New test.=