@
dhayden
No worries, credit where credit is due :+)
It seems to me that there is general advice which definitely applies to beginners or intermediate level coders, but the exact opposite of that applies to these groups:
1. Experts who know what they are doing ;
2. Those who have a reason to exploit some behaviour;
3. It is necessary for some library -
char *
or
float
for example;
4. An existing code base makes using some feature impossible or uneconomic (exceptions);
5. A constrained environment - memory say (as
Avilius mentioned ).
There are probably other examples too.
I have been fooling around with the idea of a singleton with a protected constructor, protected
constexpr
member variables, which I inherit privately. This is so I use all my constants without qualification, they aren't global, the derived class is not a singleton, and I avoid the overhead of creating these 20 variables 10 million times. The overhead is not so much in that there are 10 million objects, more that the calculation object has 40 odd member variables, so the constants represent an overhead in percentage terms. Maybe there is another way of doing it? I have looked at a few different things.
Any way that is another story, if anyone is interested I can start a new topic. This is the document I am working from - it is chapter's 4 & 5 I have been dabbling with for more than a year due to life's other needs :+)
Regards to all :+)