D
Don Kim
When I try to compile the following from the ECMA Docs:
#using <mscorlib.dll>
using namespace System;
public value class point {
int Xor;
int Yor;
public:
property int X {
int get() { return Xor; }
void set(int value) { Xor = value; }
}
property int Y {
int get() { return Yor; }
void set(int value) { Yor = value; }
}
point() {
move(0, 0);
}
point (int x, int y) {
move(x, y);
}
void move(int x, int y) {
X = x; //absolute move
Y = y;
}
void translate(int x, int y) {
X += x;
Y += y;
}
};
int main()
{
point p1;
p1.X = 10;
p1.Y = 5;
p1.move(5, 7);
point p2(9, 1);
p2.translate(-4, 12);
}
I get this error:
8_8_4.cpp(18) : error C3417: 'point:oint' : value types cannot contain
user-defined special member functions
Anyone know why?
-Don Kim
#using <mscorlib.dll>
using namespace System;
public value class point {
int Xor;
int Yor;
public:
property int X {
int get() { return Xor; }
void set(int value) { Xor = value; }
}
property int Y {
int get() { return Yor; }
void set(int value) { Yor = value; }
}
point() {
move(0, 0);
}
point (int x, int y) {
move(x, y);
}
void move(int x, int y) {
X = x; //absolute move
Y = y;
}
void translate(int x, int y) {
X += x;
Y += y;
}
};
int main()
{
point p1;
p1.X = 10;
p1.Y = 5;
p1.move(5, 7);
point p2(9, 1);
p2.translate(-4, 12);
}
I get this error:
8_8_4.cpp(18) : error C3417: 'point:oint' : value types cannot contain
user-defined special member functions
Anyone know why?
-Don Kim