On Aug 7, 2013, at 12:09 PM, Tom Browder wrote:

> Better to use one step construction (and zero instead of NULL per
> Scott Meyers)?:
> 
>  std::vector<STEPentity *> vertex_pnts(brep->m_V.Count(), 0);

Zero instead of NULL is a carry-over nitpick from pre-standardization days that 
I wouldn't worry about.  The C++ standard now defines NULL as 0, so it 
shouldn't matter other than conveying intent (that it's a pointer).

What's really needed is for the compiler to be aware that it's a null pointer 
so it can issue proper warnings about dereferencing one or setting to 
non-pointer types.  The latest C++11 standard addresses this with the new 
"nullptr" keyword.

If we really want clean construction, we could test for nullptr during cmake 
and add a line like this to common:

#ifndef HAVE_NULLPTR
static const int nullptr = 0;
#endif

Or go hog wild and create a nullptr_t class so errors are issued when used in 
invalid contexts.

Cheers!
Sean


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to