Constructors and operator=() aren't part of the language?
I didn't say anything against copy-constructor or operator=(), so I didn't understand your argument there. That's why I thought you meant pimpl.
I only said that there is an additional possibility of failures, that was my point and nothing more.
No it's not. It's a different design.
Ok, it is a hack design or a bad design
Come back with some profiler results and I'll consider your argument.
This response is simply ... I don't know the best word for it in english ... perhaps it is better that way :|
You can also think a bit about performance without using a profiler. It is a fact that the windows heap that is used through new in C++ is optimized for bigger and slow for small objects.
That is also why Andrei Alexandrescu implements a small object allocator in his book Modern C++ Design. There are also other books pointing out, that the heap in C++ is very slow for small objects and you should better consider copying them.
But well ... if you simply want to ignore facts ... go on ...
C++ const objects are bitwise const, not logical const. Security of what is lost? We're talking about mutable members.
No we aren't or not only. When Laurent said he thought about using pimpl we changed to the use of pimpl for the whole class. Because only that way, you can have all those things that he listed
Dravere