|
|
|
|
|
by dmunoz
4306 days ago
|
|
Bjarne has been on a bit of a promotion tour recently. Here is another Q&A session he did with Slashdot on the 20th [0]. I suppose this is because of the recent standardization of C++14. One thing I don't particularly agree with is that some of his examples of C++ code use features that will not be made available for years, likely around or after 2017 when C++17 should be standardized. This is assuming compilers implement the standard quickly, which is worse on some platforms than others (cough Visual Studio cough). What I'm specifically talking about is any example that mentions concepts, but at least he is clear that concepts are only currently available in a branch of GCC. [0] http://features.slashdot.org/story/14/08/20/011231/interview... |
|
The syntax for concepts seems pretty well set now, and Alex Stepanov (author of the STL, and worked with Bjarne on the new concept model), in his Amazon A9 lectures (available on YouTube) recommends you simply #define concept names to "typename" so they at least exist in your code as documentation.
The most important thing however is really to get people writing their generic code with a concious awareness of what their type requirements actually are, and then to document and specify them correctly, just like you'd rightly expect a function written in C99 to specify clearly what the pre and post conditions are... something the compiler can't help you with even today.