0
struct Cord
{
int x_cord;
int y_cord;
Cord(int x = 0,int y = 0):x_cord(x),y_cord(y) {}
bool operator < (const Cord& cord) const
{
if (x_cord == cord.x_cord)
{
return y_cord < cord.y_cord;
}
return x_cord < cord.x_cord;
}
bool operator == (const Cord& cord) const
{
return x_cord == cord.x_cord && y_cord == cord.y_cord;
}
};
std::set<Cord> cordRes,cordTmp;//initialized before
std::set<Cord> cordItersect;
std::set_intersection(cordRes.begin(),cordRes.end(),cordTmp.begin(),cordTmp.end(),cordRes.begin(),cordItersect.begin());
위의 코드에 대한 컴파일이 실패합니다. 모든 예제에서는 예제에서 set_intersection
을 올바르게 사용합니까? 감사합니다올바른 방법으로 set_intersection을 사용하십시오.