J
Jaap Versteegh
I have overloaded the addition operator for a class like this:
=====
namespace Geom {
class Node {
...
}
Node operator+ (Node& n1, Node& n2)
{
...
}
void f()
{
Node t1;
Node t2;
Node t3;
Node t4;
t4 = t1 + t2; // ok
t4 = t1 + t2 + t3; //error
}
}
=========
It produces the following error:
error: no match for 'operator+' in
'Geom:perator+(Geom::Node&,Geom::Node&)((&t2)) + t3'
Could someone please explain to me what the problem is and how to solve it ?
TIA,
Jaap Versteegh
=====
namespace Geom {
class Node {
...
}
Node operator+ (Node& n1, Node& n2)
{
...
}
void f()
{
Node t1;
Node t2;
Node t3;
Node t4;
t4 = t1 + t2; // ok
t4 = t1 + t2 + t3; //error
}
}
=========
It produces the following error:
error: no match for 'operator+' in
'Geom:perator+(Geom::Node&,Geom::Node&)((&t2)) + t3'
Could someone please explain to me what the problem is and how to solve it ?
TIA,
Jaap Versteegh