I have the following C++-class:
// Header-File class A { public: A(); private: B m_B; C m_C; }; // cpp-File A::A() : m_B(1) { m_B.doSom
Just use comma expressions:
A::A() : m_B(1) , m_c(m_B.doSomething(), m_B.doMore(), m_B.getSomeValue()) { }
Obviously, as others have explained, m_B better be declared before m_C else m_B.doSomething() invokes undefined behavior.
m_B
m_C
m_B.doSomething()