I wrote a small coordinate class to handle both int and float coordinates.
template class vector2 { public: vector2() { memset(this, 0, s
This might work instead:
char buffer[sizeof(vector2)]; memset(buffer, 0, sizeof(buffer)); vector2 *v2 = new (buffer) vector2();
..or replacing/overriding vector2::new to do something like that. Still seems weird to me though.
Definitely go with
vector2(): x(0), y(0), {}