Watch the following example:
class A {
public:
A(int param1, int param2, int param3) {
// ...
}
};
class B : public A {
public:
B() : m_param1(1), m_param(2), m_param(3), A(m_param1, m_param2, m_param3) {
// ...
}
};
B b;
Obviously, when "b" will be created, A's ctor will be called before the parameters of B will be initialized.
This rule prevents me from creating "wrapper" classes which simplify the class's initialization.
What is the "right way" for doing it?
Thanks, Amir
PS: In my particular case, the parameters are not primitives, this example just helped me to explain myself.