問題のコード:
struct PCArea {
PCArea(
int minxx = 0,
int minyy = 0,
int maxxx = 0,
int maxyy = 0
) {}
};
struct NDCVolume {
NDCVolume() {}
operator PCArea() const;
};
// how does this operator work? how to use/read it?
NDCVolume ::operator PCArea() const {
return PCArea(iminx, iminy, imaxx, imaxy);
}
冗長なコードはスニペットから削除されました。Visual Studio > Find All References を使用しましたが、使用されている場所を見つけることができません。私には、指定された戻り値のないメンバー メソッドのように見えます。
下とどう違うの?
PCArea NDCVolume::PCArea() const;