Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #86764

Re: `bool` in pointer arithmetic: when does the promotion occur, if ever?

Path csiph.com!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c++
Subject Re: `bool` in pointer arithmetic: when does the promotion occur, if ever?
Date Sun, 02 Oct 2022 12:37:46 -0700
Organization A noiseless patient Spider
Lines 14
Message-ID <86czbaj9th.fsf@linuxsc.com> (permalink)
References <tde0o3$3nqef$1@dont-email.me> <tde24g$3o0ua$1@dont-email.me> <tde3ab$3o7iu$1@dont-email.me> <tde69i$3oucq$1@dont-email.me> <tdec2o$3q32d$1@dont-email.me> <tdfg0k$dbm$1@dont-email.me> <tdgi76$3p1q$1@dont-email.me> <868rmkn2k7.fsf@linuxsc.com> <b79ea01a-2cb1-4122-b335-14d0ca45c041n@googlegroups.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info reader01.eternal-september.org; posting-host="ebe72c05e9167e1dd1c2f9bc3baee014"; logging-data="1901219"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tZFaCkTWhCYlkdIZbTP8GQbiIneEaqcQ="
User-Agent Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock sha1:Jxd7b/BPY21PDq32wW9VlXyRBCk= sha1:8eiwR+6chlKHAxt1kkUnUQRDGZw=
Xref csiph.com comp.lang.c++:86764

Show key headers only | View raw


Language Lawyer <language.lawyer@gmail.com> writes:

>> Section 7.4 is written with the assumption that there  will be two
>> operands being treated, but in this case there is  only one.  Thus a
>> solution is to revise 7.4 so it addresses the  more general scenario
>> of converting one or more operands.
>
> Or explicitly say in [expr.add] that the promotion is performed on
> the integer or enumeration operand,

Seems like a bandaid.  I think it would be better to add a case
to the usual arithmetic conversions that covers the case of a
pointer and a non-pointer.

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

`bool` in pointer arithmetic: when does the promotion occur, if ever? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-08-15 10:45 -0700
  Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? David Brown <david.brown@hesbynett.no> - 2022-08-15 20:09 +0200
    Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-08-15 11:29 -0700
      Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-08-15 11:35 -0700
      Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? David Brown <david.brown@hesbynett.no> - 2022-08-15 21:20 +0200
        Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? red floyd <no.spam.here@its.invalid> - 2022-08-15 13:49 -0700
        Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-08-15 13:59 -0700
          Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? David Brown <david.brown@hesbynett.no> - 2022-08-16 09:12 +0200
            Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-08-16 09:56 -0700
              Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-09-15 07:18 -0700
                Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Language Lawyer <language.lawyer@gmail.com> - 2022-09-19 03:28 -0700
                Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-10-02 12:37 -0700
  Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-08-15 14:36 -0700
    Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-15 14:57 -0700
  Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-08-16 21:13 +0200
  Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Language Lawyer <language.lawyer@gmail.com> - 2022-08-17 09:08 -0700

csiph-web