public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Tim Song <t.canens.cpp@gmail.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
	"libstdc++" <libstdc++@gcc.gnu.org>,
	 gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [committed] libstdc++: Add std::is_scoped_enum for C++23
Date: Sat, 20 Mar 2021 08:58:02 +0000	[thread overview]
Message-ID: <CAH6eHdTwdCygHGZ4ec4baNUgb7aKcWet9gMfWJJrdK2sWwmPCA@mail.gmail.com> (raw)
In-Reply-To: <CAPQZVxshnE1xE9DwBG-S3H2=s6ERmMr7BW2Rh_-V128iv_+ajQ@mail.gmail.com>

On Sat, 20 Mar 2021, 01:13 Tim Song via Libstdc++, <libstdc++@gcc.gnu.org>
wrote:

> On Fri, Mar 19, 2021 at 3:13 PM Jonathan Wakely via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
> >
> > Implement this C++23 feature, as proposed by P1048R1.
> >
> > This implementation assumes that a C++23 compiler supports concepts
> > already. I don't see any point in using preprocessor hacks to detect
> > compilers which define __cplusplus to a post-C++20 value but don't
> > support concepts yet.
> >
> > libstdc++-v3/ChangeLog:
> >
> >         * include/std/type_traits (is_scoped_enum): Define.
> >         * include/std/version (__cpp_lib_is_scoped_enum): Define.
> >         * testsuite/20_util/is_scoped_enum/value.cc: New test.
> >         * testsuite/20_util/is_scoped_enum/version.cc: New test.
> >
> > Tested powerpc64le-linux. Committed to trunk.
> >
>
> Using __underlying_type breaks for incomplete enumeration types. GCC
> doesn't have incomplete scoped enums due to
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89025 but unscoped ones
> exist:
>
> enum E {
>     x = std::is_scoped_enum_v<E>
> };
>

Thanks, I'll just use int then. Maybe not until Monday though.

  reply	other threads:[~2021-03-20  8:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 20:11 Jonathan Wakely
2021-03-20  1:11 ` Tim Song
2021-03-20  8:58   ` Jonathan Wakely [this message]
2021-03-20 14:18     ` Tim Song
2021-04-08 11:09       ` Jonathan Wakely

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=CAH6eHdTwdCygHGZ4ec4baNUgb7aKcWet9gMfWJJrdK2sWwmPCA@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=t.canens.cpp@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).