Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #121565
| From | Paavo Helde <eesnimi@osa.pri.ee> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: How good is your C++ knowledge? |
| Date | 2025-02-10 17:18 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <vod5cs$18mn8$1@dont-email.me> (permalink) |
| References | (3 earlier) <vocd83$14hnv$1@dont-email.me> <vocht9$157k2$1@dont-email.me> <vociol$15fqo$1@dont-email.me> <vod0as$17tkl$1@dont-email.me> <vod42t$18jkd$1@dont-email.me> |
On 10.02.2025 16:56, Muffley@PillowHQ.org wrote:
> On Mon, 10 Feb 2025 15:52:28 +0200
> Paavo Helde <eesnimi@osa.pri.ee> wibbled:
>> On 10.02.2025 12:00, Muffley@PillowHQ.org wrote:
>>> I'm not aware of what was in the language when it was still C-with-classes,
>>> but operator overloading AFAIK is, if not an original feature then certainly
>>> a very old one, and the postfix syntax is a fugly hack.
>>
>> Operator overloading predates C++ and is already present in C. In C, the
>> expression `x >> 1` works both for unsigned int, unsigned long, and
>> unsigned long long, and produces different opcodes and different result
>> types for them. That's clear overloading.
>
> Don't be willfully dumb, you know what I mean. Eg:
>
> myclass &operator++ (int)
> {
> :
> }
>
> The 'int' is a ridiculous hack to signify postfix. There are far neater ways
> it could have been done, eg a post_operator keyword or something similar.
I see. I was indeed wondering what you mean by 'postfix', but the
current thread is all about <<...>> and [[...]], so I was confused.
I rarely write my own iterator classes, so the weird syntax of postfix
increment does not bother me so much. I have never used a lambda for
indexing an array, so the '[[' issue has not bothered me either.
OTOH, the `>>` misparse was indeed a nuisance in the past.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How good is your C++ knowledge? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-01-14 09:31 -0800
Re: How good is your C++ knowledge? David Brown <david.brown@hesbynett.no> - 2025-01-14 20:25 +0100
Re: How good is your C++ knowledge? Chris Ahlstrom <OFeem1987@teleworm.us> - 2025-01-14 15:11 -0500
Re: How good is your C++ knowledge? Phillip <nntp@fulltermprivacy.com> - 2025-01-14 15:57 -0500
Re: How good is your C++ knowledge? Lynn McGuire <lynnmcguire5@gmail.com> - 2025-01-15 00:13 -0600
Re: How good is your C++ knowledge? Paavo Helde <eesnimi@osa.pri.ee> - 2025-01-15 17:51 +0200
Re: How good is your C++ knowledge? Muttley@DastardlyHQ.org - 2025-01-15 16:37 +0000
Re: How good is your C++ knowledge? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-01-18 07:55 -0800
Re: How good is your C++ knowledge? Vir Campestris <vir.campestris@invalid.invalid> - 2025-01-22 11:23 +0000
Re: How good is your C++ knowledge? Paavo Helde <eesnimi@osa.pri.ee> - 2025-01-22 16:30 +0200
Re: How good is your C++ knowledge? Rosario19 <Ros@invalid.invalid> - 2025-01-20 13:17 +0100
Re: How good is your C++ knowledge? Muttley@DastardlyHQ.org - 2025-01-20 16:12 +0000
Re: How good is your C++ knowledge? Andrey Tarasevich <noone@noone.net> - 2025-02-08 21:22 -0800
Re: How good is your C++ knowledge? James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-02-09 16:17 -0500
Re: How good is your C++ knowledge? Muffley@PillowHQ.org - 2025-02-10 08:26 +0000
Re: How good is your C++ knowledge? David Brown <david.brown@hesbynett.no> - 2025-02-10 10:46 +0100
Re: How good is your C++ knowledge? Muffley@PillowHQ.org - 2025-02-10 10:00 +0000
Re: How good is your C++ knowledge? Paavo Helde <eesnimi@osa.pri.ee> - 2025-02-10 15:52 +0200
Re: How good is your C++ knowledge? Muffley@PillowHQ.org - 2025-02-10 14:56 +0000
Re: How good is your C++ knowledge? Paavo Helde <eesnimi@osa.pri.ee> - 2025-02-10 17:18 +0200
Re: How good is your C++ knowledge? Muffley@PillowHQ.org - 2025-02-10 15:53 +0000
csiph-web