Call a non member funcion on an instance before is constructed.
- by Tom
Hi everyone.
I'm writing a class, and this doubt came up. Is this undef. behaviour? On the other hand, I'm not sure its recommended, or if its a good practice. Is it one if I ensure no exceptions to be thrown in the init function?
//c.h
class C{
float vx,vy;
friend void init(C& c);
public:
C();
~C();
};
//c.cpp
C::C()
{
…