public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: "Daniel Krügler" <daniel.kruegler@gmail.com>
Cc: libstdc++ <libstdc++@gcc.gnu.org>,
	gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [committed] libstdc++: Add lightweight replacement for std::numeric_limits (PR 92546)
Date: Mon, 17 Feb 2020 17:19:00 -0000	[thread overview]
Message-ID: <20200217171855.GV9441@redhat.com> (raw)
In-Reply-To: <CAGNvRgCfiinXsdZjZHaax72iRU1p7ZCeZ=6eLbf1x_t_HjaSuQ@mail.gmail.com>

On 17/02/20 17:26 +0100, Daniel Krügler wrote:
>Am Mo., 17. Feb. 2020 um 16:33 Uhr schrieb Jonathan Wakely <jwakely@redhat.com>:
>>
>> Many uses of std::numeric_limits in C++17 and C++20 features only really
>> need the min(), max() and digits constants for integral types. By adding
>> __detail::__int_limits we can avoid including the whole <limits> header.
>
>numeric_limits has specializations for cv-qualified types, but for
>__ini_limits there is only an undefined specialization for bool.
>Shouldn't the same undefined specialization be provided for cv bool?
>It may be that currently all usages of that trait apply on already
>unqualified types, but this might be a fragile assumption.

The specialization for bool is only there to catch misuses by the
library, it's not really necessary. But I agree that also catching
errors for const bool makes sense. I don't think we need to care about
volatile.

I'm tempted to make __int_limits<const T> an error though, it's not
needed.

  reply	other threads:[~2020-02-17 17:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 15:32 Jonathan Wakely
2020-02-17 15:48 ` [committed] libstdc++: Reduce header dependencies for C++20 " Jonathan Wakely
2020-02-17 16:26 ` [committed] libstdc++: Add lightweight replacement for std::numeric_limits " Daniel Krügler
2020-02-17 17:19   ` Jonathan Wakely [this message]
2020-02-28 22:02 ` 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=20200217171855.GV9441@redhat.com \
    --to=jwakely@redhat.com \
    --cc=daniel.kruegler@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /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).