Is this STL use correct?

Started by
10 comments, last by Rattrap 18 years, 11 months ago
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.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
Advertisement
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

Quote:
"do as the ints do"

"I can't believe I'm defending logic to a turing machine." - Kent Woolworth [Other Space]

This topic is closed to new replies.

Advertisement