www.digitalmars.com         C & C++   DMDScript  

D - overloaded member bug

reply imr1984 <imr1984_member pathlink.com> writes:
ok so i created a struct with 2 methods like this:

struct mat4
{
float m[16];
void translate(vec3 vec){...}//used to apply a translation to this matrix

static mat4 translate(vec3 vec){...}//returns a translation matrix
}

and when i use the struct like so:

mat4 myMatrix;

myMatrix.translate(myVec);

//the STATIC overloaded function is called instead of the non static one. The
only way i could make the non static one get called is by commenting out the
static one.

the compiler should be able to see from this context that its the non static
overloaded function that i want to call, but evidently it doesnt.
Feb 21 2004
parent Manfred Nowak <svv1999 hotmail.com> writes:
On Sat, 21 Feb 2004 10:36:54 +0000, imr1984 wrote:

[...]
 void translate(vec3 vec){...}//used to apply a translation to this
 matrix static mat4 translate(vec3 vec){...}//returns a translation matrix
[...] Are you sure that your compiler did not yield an error like `function translate conflicts with mat4.translate '? So long.
Feb 21 2004