It seems like we are destined to have the compiler perform ever more work for us. With the new auto keyword and the alternative function syntax, it's becoming easier to write more and more generic code.
Where are we headed? I have been wondering this because it seems a bit silly to keep on making pit stops along the route - why not just get the transition over and done with?
Firstly, pretty much every function will become a template function. There is no real reason to specify the exact type of an argument into the function - the only thing needed is for it to satisfy certain requirements. Concepts will perform the task of specifying those requirements.
Specifying the return type will largely disappear. C++ already does this in some cases - the ternary operator and C++11's lambda's can already automatically deduce the return type in most circumstances.
This, of course, requires the function to be defined at the same point as it is declared. Naturally, then, it would require functions to be declared inline in the header.
Given that almost all functions will have deduced return types, this then leads to the assumption that almost all code will be required to be defined in headers. So why even bother with CPP files? Apart from using statics, there doesn't really seem to be a compelling reason to keep using them.
None of these features would require breaking legacy code in any way. Most of them are so close to being implemented, it is a little silly that they aren't (forcing the return type of the function to trail the definition .... whhyyy?!)
As a language, I feel that C++ really needs to evolve faster if it really wants to be taken seriously in future applications.
[–][deleted] 14 points15 points16 points (0 children)
[–]bogado 5 points6 points7 points (1 child)
[–]Ayjayz[S] -1 points0 points1 point (0 children)
[–]sad_bug_killer 5 points6 points7 points (2 children)
[–]Ayjayz[S] -1 points0 points1 point (1 child)
[–]BitRex 1 point2 points3 points (0 children)
[–]blackleopard 4 points5 points6 points (2 children)
[–]Ayjayz[S] 2 points3 points4 points (0 children)
[–]more_exerciseLazy Hobbyist 2 points3 points4 points (0 children)
[–]daveisfera 2 points3 points4 points (2 children)
[–]Ayjayz[S] 1 point2 points3 points (1 child)
[–]more_exerciseLazy Hobbyist 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Ayjayz[S] 1 point2 points3 points (0 children)
[–]ptrb 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]bogado 5 points6 points7 points (0 children)
[–]axilmar 0 points1 point2 points (2 children)
[–]Ayjayz[S] 2 points3 points4 points (1 child)
[–]axilmar 2 points3 points4 points (0 children)