J
jacob navia
Tomás Ó hÉilidhe said:C++ is C with more features added, and is inherently better.
This is wrong.
For instance
EXHIBIT 1
---------
template<class T, int ndims>
class NFieldBase {
public: static const T max;
};
template<int ndims> const float NFieldBase<float, ndims>::max = 1.0f;
When compiled with g++, I get this error:
test.cpp:7: error: template definition of non-template ‘const float
NFieldBase<float, ndims>::max’
(1) Why do I get this error?
(2) How do I fix it?
You see?
More is less. More complexity is less usability. More features make
complexity grow, and it is non linear. If you add <n> features, you
get <n squared> complexity increase.