lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [PATCH] C++ m11n: range-based for loops


From: Greg Chicares
Subject: Re: [lmi] [PATCH] C++ m11n: range-based for loops
Date: Thu, 12 Jan 2017 21:54:26 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.5.1

On 2017-01-12 15:02, Vadim Zeitlin wrote:
> On Thu, 12 Jan 2017 10:24:22 +0000 Greg Chicares <address@hidden> wrote:
[...]
> GC> Lastly, on a comic note, at first I thought clang-tidy must have
> GC> gotten confused here:
> GC> 
> GC> -    typedef std::vector<std::string>::const_iterator aut0;
> GC> -    for(aut0 i = filenames.begin(); i != filenames.end(); ++i)
> GC> +    for(auto const& fn: filenames)
> GC> 
> GC> because no such name as 'aut0' could possibly exist in lmi...but it
> GC> must have been an abbreviation for "authenticity", and I guess in
> GC> 2006 I wasn't thinking of 'auto' as a keyword (except as a nearly
> GC> forgotten artifact of K&R C).
> 
>  Really? I was -- of course -- also confused when reviewing this change,
> but then I decided that you must have had used "aut0" as an emulation of
> "auto" in C++11 and even thought that it was a fun way of gently mocking
> C++98. Have you really not done this on purpose?

It seems too precious to have been anything but deliberate, but if so,
I had forgotten it so completely that it really did startle me, and I
was almost wondering whether you had fed a paper copy of the source to
clang-tidy through a faulty OCR device. Now I'm wondering: can it
really have been serendipity? It first appeared here:

commit caa7a8d9e3350053a072bd0b54f677b522860083
Author: Gregory W. Chicares <address@hidden>
Date:   2006-12-14 23:39:29 +0000

Searching google's book collection for "C++ auto keyword" prior to
2006-12 finds:

Dewhurst, 2005: "The auto keyword can be used to indicate that an
automatic variable (a function argument or a local variable) is
automatic."

Deitel, 2005: "Keywords auto and register are used to declare variables
of the automatic storage class."

But wait...

Abrahams, 2005: "There has been much discussion recently, spearheaded
by Bjarne Stroustrup himself, about reusing the vestigial auto keyword
to get type deduction in variable declarations"

I never read that book, yet I did subscribe to this magazine:

C and C++ Users Journal, Volume 22: "There is talk that C++Ox will
enhance the auto keyword, so that it will be a placeholder for a type
deduced by the compiler"

But this is starting to sound like some joke where the math professor
returns in fifteen minutes and say "Yes, it *was* a joke".

OTOH, "eftsoons" was funny in 1798, and is even funnier today.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]