| Deutsch English Français Italiano |
|
<cone.1736303554.245883.371457.1000@ripper.email-scan.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Sam <sam@email-scan.com>
Newsgroups: comp.lang.c++
Subject: Re: We have a new standard!
Date: Tue, 07 Jan 2025 21:32:34 -0500
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <cone.1736303554.245883.371457.1000@ripper.email-scan.com>
References: <cone.1735919451.379621.297354.1000@ripper.email-scan.com> <vl9eq7$1n1d$1@dont-email.me> <cone.1735956395.711486.303344.1000@ripper.email-scan.com> <vlbte2$imdo$1@dont-email.me> <vlg4qr$1hinc$1@dont-email.me> <vljasv$27g6v$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; delsp=yes; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 08 Jan 2025 03:32:36 +0100 (CET)
Injection-Info: dont-email.me; posting-host="a5313f35bdfec4e65cb7bd0cb6dfdc1c";
logging-data="2621972"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BVGjNfSeAvkDNt1V267r8"
Cancel-Lock: sha1:4unZizVRMbH86A+a8a/gIyCDjHw=
Content-Disposition: inline
X-Mailer: https://www.courier-mta.org/cone/
X-Shameless-Plug: https://github.com/svarshavchik
Bytes: 2584
Chris Ahlstrom writes:
> Muttley@DastardlyHQ.org wrote this post while blinking in Morse code:
>
> > I never understood the point of that. Why not increase the semantic scope
> > of "typedef" instead of having 2 keywords that in a lot of circumstances
> > do the same thing?
>
> Because using is a nicer to read?
I was wondering about that, too. I forget the exact keywords I used when
searching for the answer, but I did read a convincing argument in favor of
a using declaration.
This was not the main argument, but there are some things that can be done
with using that cannot be done with a typedef. For example, using a real-
life example:
template<typename basedon_t>
using derivedvaluelist=ref<derivedvalueListObj<basedon_t>,
derivedvalueListBase<basedon_t>>;
There is no equivalent typedef declaration, for this.
Given that, here's the main argument: if you originally start out with a
using declaration, instead of a typedef:
using derivedvaluelist=ref<derivedvalueListObj, derivedvalueListBase>;
then, at some point later: going from that, to the template, looks more
"logical" then replacing a typedef with something else, entirely.
TLDR: the "left" and the "right" side component, of the alias declaration,
is consistent, versus swapped.