Quote:Original post by dmatterQuote:Yeah. Bizarre, isn't it? But file streams actually use it to let you test if a stream is good or not!Yeah but a zeroed vector isn't a 'bad' vector. [smile]
Neither is a zeroed integer. Although, I've decided I'll fix this when AND IF the problem occurs.
Also: even though I do a vector = vector * float every frame, I've never had a problem with it not know whether it should convert the vector to a bool. Partially because the problem would only come up if the vector was NOT a float. Even so, I found that by making the second operand a different class according to the template, I didn't have to worry about this.
Quote:Original post by bitshifter
Debugging code is twice as hard as writing it.
So if you write the code as cleverly as possible,
it is virtually impossible for you to debug it.
Mind pointing out some particularly clever code? Also: if it's clever, but easy to understand, it's no harder to debug. The problem, and this is where that quote came from, is when code is completely unreadable.
Quote:Original post by dmatter
The rule is to use non-members whenever members aren't necessary. The exceptions to the rule are to use members if that makes things significantly more efficient (normalise is arguably an example of this) or when they improve the useability of the class (can think of no examples for a vector).
The suggestion is. The only RULES I have to worry about should be those set upon me by my compiler and C++. My personal preference dictates that variables should be as PUBLIC as possible (I won't use accessors) and functions should be in a class, not for. I will consider your suggestions and reject your rules.
That being said, someone suggested I show the updated version, so I replaced the one up top with the new one (v2).