Is there any way in C++ to have a constructor both initialize a reference to poi...
Andrew Zonenberg @azonenberg@ioc.exchange
Is there any way in C++ to have a constructor both initialize a reference to point to something, and also assign a value to it, in an initializer list?
Or do you have to initialize the reference in the initializer list then assign the value in the body?
Like can I do
class foo
{
bar& m_bar;
foo(bar& baz)
: m_bar(baz)
, m_bar(42)
{
}
}