News for hackers. Stuff that matters.
Re:CppCon 2018: Simplicity: Not Just For Beginners [video] by pjmlp on Friday September 28, 2018 @01:48PM (#18095376)
Sure you can, by introducing language features that make it easier to achive the same while being less error prone.

For example, in template metaprogramming we can get rid of tag dispatch and SFINAE thanks to static asserts, constexpr and if constexpr.

Likewise you might decide to shot your code with C style arrays, or use the STL data types with bounds checking enabled instead.

Re:CppCon 2018: Simplicity: Not Just For Beginners [video] by danbolt on Friday September 28, 2018 @02:33PM (#18095811)
I hope that at some point C++ programming can have a solid "good parts" style guide, akin to Crockford's JavaScript book.

I feel a lot of that probably isn't conventionally achievable since C++ covers a lot of situations with different needs, but if 20% of the functionality could cover 80% of the needs at some point I think it'd be great for the language.

Re:CppCon 2018: Simplicity: Not Just For Beginners [video] by AnimalMuppet on Friday September 28, 2018 @03:09PM (#18096154)
Stroutrup's "Tour of C++" might be what you're looking for.
Re:CppCon 2018: Simplicity: Not Just For Beginners [video] by berti on Saturday September 29, 2018 @09:29AM (#18100202)
Re:CppCon 2018: Simplicity: Not Just For Beginners [video] by beached_whale on Friday September 28, 2018 @10:58PM (#18098465)
static asserts do not replace tag dispatch and SFINAE as they don't affect the overload set, the instantiation has already happened at that point. However, concepts will do this in, probably, c++20. For now, is_detected is like a concepts lite that allows for a big simplification.

One thing to remember though is that there are two things at play here. The library writers tools, like TMP, and the users. The users can do a lot and never worry about SFINAE/tag dispatch. The library writers use it to allow the users of the library to have a potentially very simple experience.

Also, Greenfield C++ can be way different than pre 2011 C++. The cost of things that people would work around has gone way done to zero in some cases. Like returning a value from a function is like constructing it in place at the caller. So that takes away a need to use the heap to allocate it or to copy it when you return it.

Re:CppCon 2018: Simplicity: Not Just For Beginners [video] by beached_whale on Friday September 28, 2018 @11:10PM (#18098514)
I should say, I mean the overload has already been found at that point.
Re:CppCon 2018: Simplicity: Not Just For Beginners [video] by pjmlp on Saturday September 29, 2018 @06:39AM (#18099674)
Thanks for the correction, I was simplifying, without going into enable_if details and such.
Re:CppCon 2018: Simplicity: Not Just For Beginners [video] by beached_whale on Saturday September 29, 2018 @11:47AM (#18101009)
enable_if is ugly. But a lot of the extra ugliness is people putting everything into the condition and not abstracting the parts of it into other traits. Just like looking at long functions.