A more realistic example of something you might actually see:
(a=c-b).normalize();
Assuming vectors, this makes a a normal that points in the direction b to c.
Also, it is legal with int. Example:
int a = 0;
((a = 1) = 2);
a should be 2 after this.
Is this STL use correct?
What Scott Meyer meant by "it's good enough for ints", is that an int is a built in datatype. And that is acceptable behavior for a bulitin type, then it should probably be acceptable behavior for an object, which is creating a new datatype.
And see the post above about a better example.
[edit]
Also snk_kid basically made the same comment
And see the post above about a better example.
[edit]
Also snk_kid basically made the same comment
Quote:
"do as the ints do"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement