I tried it 9 times, 3 each with different orders. Exact code as in the original post except changing the order in main. Using VC++ 7.1 Release build. vector wins every time no matter what I try with main. High and low examples:
Code:
x = -802947072
a: 11.406
x = -802947072
v: 10.157
x = -802947072
d: 10.359
Code:
x = -802947072
d: 10.281
x = -802947072
v: 9.687
x = -802947072
a: 10.094
I ran this main and got the results below:
Code:
	{
		V v;
		TIME_IT(func, v);
	}
	{
		D d;
		TIME_IT(func, d);
	}
	{
		D d;
		TIME_IT(func, d);
	}
	{
		V v;
		TIME_IT(func, v);
	}
	{
		V v;
		TIME_IT(func, v);
	}
	{
		D d;
		TIME_IT(func, d);
	}
Code:
x = -802947072
v: 10.015
x = -802947072
d: 10.328
x = -802947072
d: 10.234
x = -802947072
v: 9.907
x = -802947072
v: 10.156
x = -802947072
d: 10.234
VC++ 8.0 with _SECURE_SCL defined to 0:
Code:
x = -802947072
d: 9.718
x = -802947072
v: 9.656
x = -802947072
v: 9.688
x = -802947072
d: 9.5
x = -802947072
d: 9.578
x = -802947072
v: 9.735
The moral: there's little to no difference in speed. Meanwhile, look how easy it is to write the class with vector, and how easy it is to write a class with incorrect copy semantics with new[]/delete[].