I was making a vector class for fun and when I made the = operator function, the compiler doesn't require me to add return *this; to be valid? Is this standard or a compiler thing (VSC++ 2008 express)?
1 2 3
Vec2f& operator=(const Vec2f& avec){
x = avec.x; y = avec.y;
}
I don't know why but some compilers won't complain if you don't return a value from a function. This is a problem because then what the compiler returns is undefined (which is especially dangerous because you're returning a reference.
So yeah, you should definitely be returning something here.