This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with using "pEdge==NULL"


Jeffrey Holle skrev:
> I'm creating an application that attempted to employ the statement:
>   if(m_future.getEdges().second!=NULL)
Since this is C++ you should not use NULL anyway. so the above code
should be
  if (m_future.getEdges().second)

(See the book by Bjarne Stroustrup, the creator of C++, "The C++
Programming Language", published in year 2000: quote from page 88:
"In C, it has been popular to define a macro NULL to represent the zero
pointer. Because of C++'s tighter type checking, the use of plain 0,
rather than any suggested NULL macro, leads to fewer problems." At page
433, he calls the NULL macro "infamous".)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]