O
Olaf Baeyens
I create a operator + in C#
public static HistogramBuffer operator+(HistogramBuffer
aHistogramBuffer1, HistogramBuffer aHistogramBuffer2) {
HistogramBuffer Tmp=new HistogramBuffer(aHistogramBuffer1);
for (int iX=0; iX<Tmp.NrOfValues; iX++) {
Tmp[iX]=Tmp[iX]+aHistogramBuffer2[iX];
}
return Tmp;
}
Now in C# I can do this:
HistogramBuffer Test1=new HistogramBuffer();
HistogramBuffer Test2=new HistogramBuffer();
Test2=Test2+Test1;
But if I do this In C++
HistogramBuffer __gc *Test1=__gc new HistogramBuffer();
HistogramBuffer __gc *Test2=__gc new HistogramBuffer();
Test2=Test2+Test1;
Then I get this error: "error C2845: '+' : cannot perform pointer arithmetic
on __gc pointer....."
Any idea how to fix this?
public static HistogramBuffer operator+(HistogramBuffer
aHistogramBuffer1, HistogramBuffer aHistogramBuffer2) {
HistogramBuffer Tmp=new HistogramBuffer(aHistogramBuffer1);
for (int iX=0; iX<Tmp.NrOfValues; iX++) {
Tmp[iX]=Tmp[iX]+aHistogramBuffer2[iX];
}
return Tmp;
}
Now in C# I can do this:
HistogramBuffer Test1=new HistogramBuffer();
HistogramBuffer Test2=new HistogramBuffer();
Test2=Test2+Test1;
But if I do this In C++
HistogramBuffer __gc *Test1=__gc new HistogramBuffer();
HistogramBuffer __gc *Test2=__gc new HistogramBuffer();
Test2=Test2+Test1;
Then I get this error: "error C2845: '+' : cannot perform pointer arithmetic
on __gc pointer....."
Any idea how to fix this?