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


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

Re: ({

From scott@slp53.sl.home (Scott Lurndal)
Subject Re: ({
Newsgroups comp.lang.c++
References <vrhmme$8v0$1@news.muc.de> <vrjgh8$1bqpn$1@dont-email.me> <vrm4rl$2ue$1@news.muc.de> <lwzDP.1208305$_N6e.415187@fx17.iad> <vrmkg3$308h$2@news.muc.de>
Message-ID <i2BDP.304568$SVG3.140032@fx42.iad> (permalink)
Organization UsenetServer - www.usenetserver.com
Date 2025-03-22 15:53 +0000

Show all headers | View raw


Alan Mackenzie <acm@muc.de> writes:
>Scott Lurndal <scott@slp53.sl.home> wrote:
>> Alan Mackenzie <acm@muc.de> writes:
>>>Paavo Helde <eesnimi@osa.pri.ee> wrote:
>>>> On 20.03.2025 20:27, Alan Mackenzie wrote:
>
>>>> It appears the statement expressions are a gcc extension which does not 
>>>> even compile in standard C++, and is probably not needed for anything in 
>>>> C++ as there are better options like templated and inlined functions.
>>>> In C there might be some usage case for it.
>
>>>I'm not sure what you meant by templated functions here, but an inline
>>>function has the disadvantage of fragmenting the code.  Rather than have
>>>a few lines of code where they're used, you need to look somewhere else
>>>to see what they do.
>
>> An inline function name should be chosen such that it is sufficient to
>> define exactly what the effect of the function call will be, while
>> still hiding the implementation and improving readability.
>
>Yes, that's fine in theory.  In practice, meaning while debugging, a
>whole lot of midget functions, each called something like
>convert_next_char_to_upper_case_is_it_Q_p is a nightmare. 

Strawman.   Nobody suggested that a meaningful name
requires forty characters.

  inline bool is_ep(void) const { return flags & PCC_EP;} 

is perfectly cromulent.

Gdb() has no problem stepping through that, and shows the
corresponding source.

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


Thread

({ Alan Mackenzie <acm@muc.de> - 2025-03-20 18:27 +0000
  Re: ({ Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-21 09:58 +0100
    Re: ({ Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-22 16:14 +0100
  Re: ({ Paavo Helde <eesnimi@osa.pri.ee> - 2025-03-21 12:54 +0200
    Re: ({ Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-21 12:27 -0700
      Re: ({ Bonita Montero <Bonita.Montero@gmail.com> - 2025-03-22 10:09 +0100
        Re: ({ Alan Mackenzie <acm@muc.de> - 2025-03-22 11:26 +0000
      Re: ({ Alan Mackenzie <acm@muc.de> - 2025-03-22 11:00 +0000
    Re: ({ Alan Mackenzie <acm@muc.de> - 2025-03-22 10:53 +0000
      Re: ({ scott@slp53.sl.home (Scott Lurndal) - 2025-03-22 14:09 +0000
        Re: ({ Alan Mackenzie <acm@muc.de> - 2025-03-22 15:20 +0000
          Re: ({ scott@slp53.sl.home (Scott Lurndal) - 2025-03-22 15:53 +0000
      Re: ({ Paavo Helde <eesnimi@osa.pri.ee> - 2025-03-22 17:18 +0200
        Re: ({ David Brown <david.brown@hesbynett.no> - 2025-03-22 17:45 +0100
    Re: ({ Jakob Bohm <egenagwemdimtapsar@jbohm.dk> - 2025-04-01 06:59 +0200

csiph-web