diff --git a/boxedcpp/boxedcpp.hpp b/boxedcpp/boxedcpp.hpp index 4c0fa41f..139a2314 100644 --- a/boxedcpp/boxedcpp.hpp +++ b/boxedcpp/boxedcpp.hpp @@ -122,12 +122,37 @@ void dump_system(const BoxedCPP_System &s) std::cout << std::endl; } +template +Ret add(const P1 &p1, const P2 &p2) +{ + return p1 + p2; +} + +template +Ret multiply(const P1 &p1, const P2 &p2) +{ + return p1 * p2; +} + + void bootstrap(BoxedCPP_System &s) { s.register_type("void"); s.register_type("double"); s.register_type("int"); s.register_type("string"); + + s.register_function(boost::function(&add), "+"); + + s.register_function(boost::function(&add), "+"); + s.register_function(boost::function(&add), "+"); + s.register_function(boost::function(&add), "+"); + s.register_function(boost::function(&add), "+"); + + s.register_function(boost::function(&multiply), "*"); + s.register_function(boost::function(&multiply), "*"); + s.register_function(boost::function(&multiply), "*"); + s.register_function(boost::function(&multiply), "*"); } #endif