I defined a typedef and:
typedef boost::geometry::model::d2::point_xy<double> boost2dPoint;
boost2dPoint min_p;
//.
//.(under a condition: min_p will be initialized)
//.
for(Region::Iterator itv = s.beginVer(); itv != s.endVer(); ++itv )
{
Region::Point v_point = (*itv).pnt();
if( (v_point(0) == min_p.x()) && (v_point(1) == min_p.y()) )
{
return *itv;
}
}
I received a warning
‘min_p’ may be used uninitialized in this function [-Wmaybe-uninitialized]
how can I check if min_p is initialized or not??
You will get this warning if you try to use a variable that has any chance of being uninitialized. You need to provide an initialization for each path. Either provide a default initialization when you declare the variable, or provide a value in the
elsecase of your condition.