I wanted to compile for myself openttd sources. It was using Squirell library which i could not compile because of linker error. I looked up into the code which could not be compiled and i saw weird construct which I ( and linker :D ) could not understand :
new ((void *)&_vals[i]) T(v._vals[i]);
I modified the code so it looks now like that :
_vals[i] = *(new T(v._vals[i]));
I do not know wheter i modified the code in good way or not. I hope that i did it. Game is not crashing right now so maybe there is a chance that it works well.
Could someone please say why this construct is not doing any compile time errors, just linker errors? What exactly is this code doing?
Important information : I'm using visual studio 2013.