Antti Tuomi
Posts: 4
Nickname: hrnt
Registered: Dec, 2006
|
|
Re: Monolith: Facts, Failures, Fallacies, Falsehoods and Furphies
|
Posted: Dec 31, 2006 5:06 AM
|
|
> Failure: C++ syntax in general is so overloaded as to have > big issues with ambiguity. >> in template syntax, function > pointer syntax, enums and structs sharing namespace but > leading to ambiguities, const correctness in > multi-referenced pointers (eg, int * can be referenced by > a const int *, but an int ** cannot be referenced by a > const int **). Seemingly innocuous code can have very > surprising results (member function template friend > declarations)
What do you mean, what is the problem with multi-referenced pointers? int ** can not be referenced by a const int **, because that would break const correctness. Consider this:
int **ptr = points somewhere; const int cInt = 5; const int **cPtr; cPtr = ptr; // not allowed cPtr[0] = &cInt // this is legal, cPtr[0] can point to const int.
But after that, ptr[0] points to const int which is not allowed, thus breaking const correctness.
> Failure: Too much worry about order of > construction/destruction and object slicing.
Can you elaborate about constructors and destructors?
|
|