C++自定义数据结构以及输出重载

C++输出<<重载方法

ostream& operator<< (ostream& out, Edge& s)
{
    out << "("<< s.u <<"," << s.v <<")" ;
    return out;
}
ostream& operator<< (ostream& out, Face& s)
{
    out << "("<< s.u <<"," << s.v << "," << s.k<<")" ;
    return out;
}

你可能感兴趣的:(C++)