my question is similar into this one, but I hadn't found info that I need. I have my class constructor.
CustomTreeViewItem::CustomTreeViewItem(CustomTreeView* list)
: m_childs(), m_expanded(false), m_list(list), m_components(), m_depth(1),
m_rect(), m_root(this)
{}
I use this
pointer in constructor but do not call any methods from that so I do not invoke undefined behavior. So everything is fine, but I got warning, now I'm writing some lib (little framework) so I have to write error-free code. So I have changed my code into this:
CustomTreeViewItem::CustomTreeViewItem(CustomTreeView* list)
: m_childs(), m_expanded(false), m_list(list), m_components(), m_depth(1),
m_rect(), m_root(NULL)
{
m_root = this;
}
Now I do not get any warning, however in this way I lose performance (very slightly, but anyway it is loss). I want to ask if there isn't any way to keep the highest performance and prevent this warning.