I read C ++ Super-FAQ . In the Constructors section I come across this statement:
BTW do NOT try to achieve this through placement. Foo (x, int (x) +7) within the body of foo :: foo (char). However that is bad, bad, bad. Please don’t write to me on your particular compiler; it's bad
The point is that it is absolutely impossible to do so:
class Foo{ public: Foo(char x){ new (this) Foo(x, int(x)+7); } Foo(char x, int y){ //... } }; Can someone explain in more detail what threatens such a trick?
UPD: I suspect that in this example, everything will be fine, and problems will begin with inheritance, dynamic resource allocation, etc.