Original Post
I thought it would be useful to make my own 3d vector implementation using expression templates. With my simple tests comparing my '+' operation only vector, it seems that the naive approach to a vector implementation may be just as good with an optimizing compiler. The test I use now is the most simple of the simple, but do you expect an expression template vector to out-perform a simple vector implementation. One that does:
class Badvec {
...
Badvec operator+(Badvec& aAdd)
{
Badvec tmp;
tmp.x = x + aAdd.x;
tmp.y = y + aAdd.y;
tmp.z = z + aAdd.z;
return tmp;
}
...
}