public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Ville Voutilainen <ville.voutilainen@gmail.com>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>,
	gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [committed] libstdc++: Make std::jthread support pointers to member functions [PR 100612]
Date: Fri, 1 Oct 2021 21:55:40 +0100	[thread overview]
Message-ID: <CACb0b4n=S4t1LRZ3Jk969Q5jaDu6C+8jwFxdwz4wXiCMsika0Q@mail.gmail.com> (raw)
In-Reply-To: <CAFk2RUYd4=kgmW+BL9aN-wvsMgBw4CyJ=ZkhtOh77+nNXjFx0w@mail.gmail.com>

On Fri, 1 Oct 2021 at 21:26, Ville Voutilainen wrote:
>
> On Fri, 1 Oct 2021 at 23:19, Jonathan Wakely via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
> >
> > 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.
>
> Yeah, and the use-case is supported by applying a wrapper that does
> the right kind of argument binding, like
> shown in the BZ. Why are we doing this?

The lambda workaround is not as convenient as having it Just Work. so
it seemed like a useful extension to try, with no downside. It doesn't
even change the is_constructible<thread, ...> result , because the
std::thread constructor isn't constrained, so is_constructible<thread,
...> is true for nearly all arg types anyway. The only
"non-conformance" is that we don't diagnose the
is_invocable_v<decay_t<F>, decay_t<Args>...> requirement if F is a
pointer-to-member-function.

Maybe I should have sent it as an RFC, or just left it in my fork not
pushed to trunk. If a proposal comes before the committee and gets
rejected then we can remove it again.


      reply	other threads:[~2021-10-01 20:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 19:43 Jonathan Wakely
2021-10-01 20:25 ` Ville Voutilainen
2021-10-01 20:55   ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACb0b4n=S4t1LRZ3Jk969Q5jaDu6C+8jwFxdwz4wXiCMsika0Q@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ville.voutilainen@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).