Boost logo

Boost :

Subject: Re: [boost] Call for interest - BOOST_AUTO_FUNCTION
From: David Abrahams (dave_at_[hidden])
Date: 2010-10-07 07:19:18


At Thu, 7 Oct 2010 02:59:00 +0200,
Robert Kawulak wrote:
>
> > From: Matt Calabrese
> > The frustrating thing is that I'm pretty sure most people who first hear
> > about auto when applied to function templates assume that it would mean
> > something along the lines of what the macro does, and then they are
> > disappointed to find out that that is not the case. I agree that for
> > arbitrarily long functions with many statements and returns it would not be
> > appropriate, but for 1-liners it seems like something that's both an
> > extremely common case and trivial for compilers to implement. At least for
> > me, it seems that the vast majority of the times one wants to use the
> > function arguments when specifying the return type it is to duplicate the
> > expression in a return statement exactly anyway. Was such an idea simply
> > never proposed despite everyone I've talked to expecting it to be there? It
> > wouldn't surprise me if the next standard remedied this, but at the moment
> > that seems light years away.
>
> If a national body would point it out as a defect in its comments,
> wouldn't that be a thing small enough to fix it before the final
> draught?

I don't know. I can tell you this, though: without an NB comment it
definitely won't happen.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk