Using gcc/g++ version 4.1.2
I'm creating an application that attempted to employ the statement:
if(m_future.getEdges().second!=NULL)
the getEdges method is defined as:
typedef std::pair<const DataEdge*,const DataEdge*> Edges;
Edges getEdges(void) const {return
std::make_pair(m_pEdge1,m_pEdge2);}
This statement always considered the second pair element as not NULL.
I've fixed my problem by creating another method:
bool isIntersection(void) const { return (m_pEdge2==NULL) ? true :
false;}
Then "if(!m_future.isIntersection())" works as expected.
It really seems like either should have worked, but only the second did.
I'd like an explanation.