Why is no return type specified in this function clearly returns?
Possible Duplicate:
Operator overloading
I am seeing this in a piece of sample code:
operator Vector2<float>() const {
return Vector2<float>(x, y); }
My 2 questions about this:
1) The function clearly returns, but there's no return type specified?
2) It's not clear exactly what is getting overloaded here, which operator.
它是一个转换运算符,返回类型是Vector2<float>
。
上一篇: 运算符在c ++中重载