Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Sam 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: References: 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 using derivedvaluelist=ref, derivedvalueListBase>; 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; 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.