[Development] RFF: nullptr rules

Sergio Martins sergio.martins at kdab.com
Thu Dec 10 17:23:50 CET 2015


On Wednesday, 9 December 2015 16:38:02 WET Joerg Bornemann wrote:

> > - in some situations, it makes code easier to understand (:
> > m_foo(nullptr)).
> So nullptr is easier to understand, because assigning 0 to a pointer
> variable didn't make clear that it now contains a null pointer?
> If there's need to signify using m_foo(nullptr) that m_foo is a pointer,
> then m_foo is maybe a bad name and should be fixed.

: m_foo(0)

What if m_foo was a bool, would you rename the variable or use false instead 
of 0 ?


Regards,
-- 
SĂ©rgio Martins | sergio.martins at kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt Experts



More information about the Development mailing list