Add registration for /=, -= and += operators
This commit is contained in:
parent
a27af663fe
commit
ed114102bc
@ -78,11 +78,29 @@ bool greater_than_equals(P1 p1, P2 p2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename P1, typename P2>
|
template<typename P1, typename P2>
|
||||||
P1 ×equal(P1 &p1, P2 p2)
|
P1 ×equal(P1 &p1, const P2 &p2)
|
||||||
{
|
{
|
||||||
return (p1 *= p2);
|
return (p1 *= p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename P1, typename P2>
|
||||||
|
P1 ÷sequal(P1 &p1, const P2 &p2)
|
||||||
|
{
|
||||||
|
return (p1 /= p2);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename P1, typename P2>
|
||||||
|
P1 &addsequal(P1 &p1, const P2 &p2)
|
||||||
|
{
|
||||||
|
return (p1 += p2);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename P1, typename P2>
|
||||||
|
P1 &subtractsequal(P1 &p1, const P2 &p2)
|
||||||
|
{
|
||||||
|
return (p1 -= p2);
|
||||||
|
}
|
||||||
|
|
||||||
//Add canonical forms of operators
|
//Add canonical forms of operators
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void add_oper_equals(BoxedCPP_System &s)
|
void add_oper_equals(BoxedCPP_System &s)
|
||||||
@ -170,6 +188,9 @@ void add_opers_arithmetic_overload(BoxedCPP_System &s)
|
|||||||
register_function(s, ÷<Ret, T, R>, "/");
|
register_function(s, ÷<Ret, T, R>, "/");
|
||||||
register_function(s, &multiply<Ret, T, R>, "*");
|
register_function(s, &multiply<Ret, T, R>, "*");
|
||||||
register_function(s, ×equal<T, R>, "*=");
|
register_function(s, ×equal<T, R>, "*=");
|
||||||
|
register_function(s, ÷sequal<T, R>, "/=");
|
||||||
|
register_function(s, &subtractsequal<T, R>, "-=");
|
||||||
|
register_function(s, &addsequal<T, R>, "+=");
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user