From ed114102bcd328770a91b6e5bcf099b157e638ed Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 6 Jun 2009 16:14:59 +0000 Subject: [PATCH] Add registration for /=, -= and += operators --- boxedcpp/bootstrap.hpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/boxedcpp/bootstrap.hpp b/boxedcpp/bootstrap.hpp index b4cc3d6..00357e2 100644 --- a/boxedcpp/bootstrap.hpp +++ b/boxedcpp/bootstrap.hpp @@ -78,11 +78,29 @@ bool greater_than_equals(P1 p1, P2 p2) } template -P1 ×equal(P1 &p1, P2 p2) +P1 ×equal(P1 &p1, const P2 &p2) { return (p1 *= p2); } +template +P1 ÷sequal(P1 &p1, const P2 &p2) +{ + return (p1 /= p2); +} + +template +P1 &addsequal(P1 &p1, const P2 &p2) +{ + return (p1 += p2); +} + +template +P1 &subtractsequal(P1 &p1, const P2 &p2) +{ + return (p1 -= p2); +} + //Add canonical forms of operators template void add_oper_equals(BoxedCPP_System &s) @@ -170,6 +188,9 @@ void add_opers_arithmetic_overload(BoxedCPP_System &s) register_function(s, ÷, "/"); register_function(s, &multiply, "*"); register_function(s, ×equal, "*="); + register_function(s, ÷sequal, "/="); + register_function(s, &subtractsequal, "-="); + register_function(s, &addsequal, "+="); } template