Re: Getting an error with lambda and async - help interpret, please
On 4/18/2013 8:34 AM, Stuart wrote:
This is an example that will turn off many people from programming C++.
If not even very experienced programmers (I would even consider Victor
a guru) can decipher the error messages of templated code, then who can?
Admittedly, even the inventor of C++ didn't have such monstrosities like
boost in mind when he introduced templates.
For the record, the inventor of C++ did meet a plenty of "interesting"
error messages, and in fis prez a week ago referred to one that exceeded
the line limit of his cygwin terminal, so he could not even look at the
start of it.
The problem was to be addressed long time ago, with 'Concepts', that
after 7+ years of work and several iterations got pulled from the
standard WP around 2008.
The good new is that the new wave of this, 'Concepts Lite' was recently
introduced and has good likehood to start official life as a standard
TS. And can get ready around the same time as C++14. Also many compiler
writers said they will implement it very soon, so chances are good the
language will be capable for good messages before calendar turns to '15.
The standard library is a different tack but I expect it to follow shortly.
However, we need some kind
of template debugging facilities in the language: if you write wrong
code, you can find the error easily in the debugger. Unfortunately there
is no "debugger" for templates. Either you get it just right or you'll
get a bunch of incomprehensible error messages. I don't know how many
hours I have spent to get the most simple boost examples to work.
Unfortunately without express constraints the compiler really is only
hit by some chance error, and can't do much better job than report that
and dump all the contexts. That is the very thing to be changed.
Look here for the initial version:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3580.pdf