Problem with destroy

Namespace rswhite4 at googlemail.com
Fri Jul 5 09:31:16 PDT 2013


----
import std.stdio;

struct vec2f {
public:
	float[2] data;
	
	alias data this;
}

void main()
{
	vec2f[] vs;
	foreach (ref vec2f v; vs) {
		.destroy(v);
	}
}
----

/d488/f18.d(14): Error: template object.destroy matches more than 
one template declaration, 
/opt/compilers/dmd2/include/object.di(593):destroy(T)(ref T obj) 
if (is(T == struct)) and 
/opt/compilers/dmd2/include/object.di(604):destroy(T : U[n], U, 
ulong n)(ref T obj)


What is the smartest way for this?


More information about the Digitalmars-d-learn mailing list