Discussion:
wxWidgets and the nullptr keyword
alidev2007 via wx-users
2014-05-16 15:37:11 UTC
Permalink
Hi Vadim

Just for curiosity, I am wondering why you didn't define a wxNULLPTR macro
like you did with wxOVERRIDE ?
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Lauri Nurmi
2014-05-16 16:20:04 UTC
Permalink
Post by alidev2007 via wx-users
Hi Vadim
Just for curiosity, I am wondering why you didn't define a wxNULLPTR
macro like you did with wxOVERRIDE ?
Hi,

I am not Vadim, but I would like to express my opinion about this.

I think giving new names to standard C++ features should be avoided when
possible. And in particular, it is possible to avoid this with nullptr.
With pre-C++11 compilers nullptr can be either emulated or defined as
zero globally. (The same cannot be done with 'override' really, as it is
a contextual keyword.)

As for emulating nullptr, Sutter and Stroustrup have presented a C++98
implementation for it:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf

LN
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-05-17 11:28:19 UTC
Permalink
On Fri, 16 May 2014 19:20:04 +0300 Lauri Nurmi wrote:

LN> I am not Vadim, but I would like to express my opinion about this.

Thanks for expressing my opinion as well ;-)

LN> I think giving new names to standard C++ features should be avoided when
LN> possible. And in particular, it is possible to avoid this with nullptr.
LN> With pre-C++11 compilers nullptr can be either emulated or defined as
LN> zero globally. (The same cannot be done with 'override' really, as it is
LN> a contextual keyword.)

I'd just add that "override" brings a very tangible benefit: using it
prevents a whole class of relatively common bugs. While using nullptr
instead of NULL doesn't change that much in practice.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
'AliKet' via wx-users
2014-05-16 16:36:02 UTC
Permalink
Hi Lauri Nurmi,

Thanks a lot for your reply.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...