|
|
|
|
|
by adev_
2228 days ago
|
|
> 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. |
|