[Development] Upgrading the sources to C++11 keywords (Q_NULLPTR, etc.)

Bo Thorsen bo at vikingsoft.eu
Wed Feb 11 10:35:38 CET 2015


Den 10-02-2015 kl. 23:17 skrev Thiago Macieira:
> My current thinking is:
>   1) modernise our headers with macros, now
>   2) allow people to use Q_NULLPTR where it helps with readability
>   3) disallow replacing of zeroes with Q_NULLPTR except as required by rules #1
>      or #2
>
> Two examples:
> a)	void *ptr = 0;
> b)	str.toInt(0, 0);
>
> In (a), use of Q_NULLPTR would make the code noisier, so don't use it. In (b),
> the first 0 could be replaced with Q_NULLPTR to indicate that yes we know it's
> a pointer, as opposed to an integer.

I think this is a perfect set of rules and sums up most of the 
discussion nicely.

+1.

Bo Thorsen,
Director, Viking Software.

-- 
Viking Software
Qt and C++ developers for hire
http://www.vikingsoft.eu



More information about the Development mailing list