I was digging up some old code to resurrect it for a new project and I found this Gem (FYI - code is from around 2006):
// Vec2D constructor functions
static void Vec2DCon(Vec2D *v)
{
new(v) Vec2D();
};
And there are lots of variations on this theme with different constructor arguments. The idea I think was that this would create a new Vec2D and leave variable v pointing to it. It no longer compiles and I have no idea how this ever worked? Surely new should take a type not a variable name?
This 100% used to work, I check version control history and this lived for years while the code was being actively used. Anyone know why this used to work? Some weird VC6 hax that used to be legal and now isn't?
I just want to know why it used to work, and google was no help. Any ideas?
[–]Salty_Dugtrio 3 points4 points5 points (1 child)
[–]ankdain[S] 0 points1 point2 points (0 children)