The use of initializer lists is generally recommended. Now suppose I have the following code (a trivial example to make the question clearer):
class foo
{
public:
foo(ptr1* a, ptr2* b) : m_a(a), m_b(b), m_val(a->val) {}
};
I would like to check that ait is not NULL before it tries to dereference it to receive val. Is there a way I can perform a sanity check?
source
share