Re:Modern C++ gamedev: thoughts and misconceptions
by adev_ on Saturday May 16, 2020 @03:57PM
(#23206699)
> I wouldn't say generics are an approximation of templates
Template (at their origins) are nothing more than generics, and a pretty clean, powerful and zero cost way of doing generics.
What you name "hazardous, unergonomic" macros style is not the template system itself. It is mainly due to all the 2005-styles SFINAE hacks that have been invented by abusing templates properties.
SFINAE in C++ is nothing natural, it's at best a dangerous trick to have compile time resolution/execution.
Fortunately all of that should die progressively with C++-17 constexpr for the good of humankind.
Re:Modern C++ gamedev: thoughts and misconceptions
by neutronicus on Saturday May 16, 2020 @04:29PM
(#23206935)
Non-type Template Parameters ("const Generics") are on the short-term road-map for Rust. Small step from there to recursion and compile-time factorial.
Rust's generics allow for some seriously powerful abstractions to be built in a very clean and readable way, although there can be friction with stuff that would be simple with templates in C++ and quite verbose in Rust.
Maybe concepts will change that.