While you’re dealing with reader’s Qs….
In your keynote in “Going Native” you mentioned that type inference should almost always be used, except for some obscure cases with expression templates.
Yes. To give people context, the idea is when declaring local variables, prefer to use auto to deduce the type. For example:
auto x = begin(v);
This seems like a rather serious wart on the language,
It’s a wart, but I don’t know about “serious” – it doesn’t come up that often. Still, your question is quite apropos:
part of the power of expression templates (to my understanding) is that they can be dropped in by a library implementer and thus improve the clients’ code without their knowledge.
Was there any discussion to allow type authors to opt-out of type inference? (e.g. by allowing an “operator auto()”). If this wasn’t discussed for C++11 is it being discussed for C++1y?
Yes, and even exactly that spelling has been suggested. I’ll take that as a +1 for discoverability if we name it that!
(For people reading this comment, if it doesn’t make any sense I wrote about it last year in my blog http://lanzkron.wordpress.com/2011/02/21/inferring-too-much/)