node
takes T
by value?T
by value?*m_pData = Data;
therenew(m_pData) T(Data)
, is that a thing? you could also use c++'s new move operator if you'd likenode **pRoot = m_pRoot;
this looks like a type error<
nor >
, I thinknode **pRoot = m_pRoot;
should be node **pRoot = &m_pRoot;
pRoot = (*pRoot)->m_pLeft;
should also have a &
operatorif(!(*pRoot))
never triggers due to the loop conditionnew
doesn't return nullptr
on failure, but throws std::bad_alloc
else if(*(*pRoot)->m_pData > Data)
{ … }
else
{
delete t;
return;
}
template
inline T distance(const vector2_base &a, const vector2_base &b)
{
return length(a-b);
}
inline float length(const vector2_base &a)
{
return sqrtf(a.x*a.x + a.y*a.y);
}