G
Gernot Frisch
Hi,
Can I define a class that has an operator+ set:
A operator+(A a, double d);
A operator+(double d, A a);
....
without defining an = operator for the class? Just different
constructors?
class A
{
A() {dat=new int[1]; *dat=0;}
A(double d) {dat=new int[1]; *dat=(int)d;}
};
--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
Can I define a class that has an operator+ set:
A operator+(A a, double d);
A operator+(double d, A a);
....
without defining an = operator for the class? Just different
constructors?
class A
{
A() {dat=new int[1]; *dat=0;}
A(double d) {dat=new int[1]; *dat=(int)d;}
};
--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com