Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: Wading through template instantiation errors for allocator Date: Wed, 08 Jan 2020 09:22:07 -0800 Organization: None to speak of Lines: 26 Message-ID: <87blrdlv7k.fsf@nosuchdomain.example.com> References: <2925c440-1188-48ff-b931-243234719891@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="4364818b1e4596b2cbe737cdaa621da2"; logging-data="20866"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zqllx3aWHRCao2Aepa6Dr" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:ev2np7PrujRGW7uHCn+uhyrrPVM= sha1:ktOlWqKAopk04oiE67dwiWDe1k4= Xref: csiph.com comp.lang.c++:71226 Ian Collins writes: > On 04/01/2020 04:04, Frederick Gotham wrote: >> auto main(void) -> int > > What kind of an abomination is this? There are some advantages to trailing return types (introduced in C++11) particularly for function templates where the return type depends on the argument types. If C++ were being designed from scratch today, I suspect that they would be the only syntax accepted, with the leading "auto" omitted. Other than historical baggage, there's no good reason to have two different syntax for return types. Some have argued that we should use trailing return types consistently in new code. Others would argue that we shouldn't use them in cases where they offer no specific advantages, simply because they're unfamiliar. I tend to fall into the latter camp, but I can imagine changing my mind eventually. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com [Note updated email address] Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */