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.cpp
C::C()
{
init(*this);
}
void init(C& c) //throws() to ensure no exceptions ?
{
c.vx = 0;
c.vy = 0;
}
Thanks in advance