operator= support in bootstrap code
This commit is contained in:
@@ -41,6 +41,12 @@ bool bool_or(P1 p1, P2 p2)
|
||||
return p1 || p2;
|
||||
}
|
||||
|
||||
template<typename P1, typename P2>
|
||||
P1 &assign(P1 &p1, const P2 &p2)
|
||||
{
|
||||
return (p1 = p2);
|
||||
}
|
||||
|
||||
template<typename P1, typename P2>
|
||||
bool equals(P1 p1, P2 p2)
|
||||
{
|
||||
@@ -138,6 +144,12 @@ void add_oper_not_equals(BoxedCPP_System &s)
|
||||
register_function(s, ¬_equals<const T&, const T&>, "!=");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void add_oper_assign(BoxedCPP_System &s)
|
||||
{
|
||||
register_function(s, &assign<T,T>, "=");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void add_oper_less_than(BoxedCPP_System &s)
|
||||
{
|
||||
@@ -220,6 +232,11 @@ void bootstrap(BoxedCPP_System &s)
|
||||
add_opers_comparison<char>(s);
|
||||
add_opers_comparison<std::string>(s);
|
||||
|
||||
add_oper_assign<int>(s);
|
||||
add_oper_assign<double>(s);
|
||||
add_oper_assign<char>(s);
|
||||
add_oper_assign<std::string>(s);
|
||||
|
||||
add_opers_comparison_overload<int, double>(s);
|
||||
add_opers_comparison_overload<double, int>(s);
|
||||
|
||||
|
@@ -24,10 +24,8 @@ void bootstrap_random_access_container(BoxedCPP_System &system, const std::strin
|
||||
template<typename Assignable>
|
||||
void bootstrap_assignable(BoxedCPP_System &system, const std::string &type)
|
||||
{
|
||||
/*
|
||||
system.register_function(
|
||||
boost::function<Assignable &(Assignable*, Assignable&)>(&Assignable::operator=), "=");
|
||||
*/
|
||||
boost::function<Assignable &(Assignable*, const Assignable&)>(&Assignable::operator=), "=");
|
||||
}
|
||||
|
||||
template<typename ContainerType>
|
||||
|
Reference in New Issue
Block a user