
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Robert Kawulak Sent: Thursday, October 07, 2010 1:59 AM To: boost@lists.boost.org Subject: Re: [boost] Call for interest - BOOST_AUTO_FUNCTION
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
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? Just thinking aloud, I don't know if it sounds reasonable at this stage of standardisation
light process. I'm sure it is too late for this standard, but I suggest you write up your justification with code examples and submit to the WG21 committee yourself (you need to get a document number and use the customary format). http://www.open-std.org/jtc1/sc22/wg21/ (Anyone can do this - but don't hold your breath!). Meanwhile, having a macro that does something that people find useful is very persuasive that your 'feature' is needed. Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com