|
|
@@ -162,17 +162,17 @@ namespace chaiscript
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (t_oper)
|
|
|
|
switch (t_oper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case Operators::equals:
|
|
|
|
case Operators::Opers::equals:
|
|
|
|
return const_var(t == u);
|
|
|
|
return const_var(t == u);
|
|
|
|
case Operators::less_than:
|
|
|
|
case Operators::Opers::less_than:
|
|
|
|
return const_var(t < u);
|
|
|
|
return const_var(t < u);
|
|
|
|
case Operators::greater_than:
|
|
|
|
case Operators::Opers::greater_than:
|
|
|
|
return const_var(t > u);
|
|
|
|
return const_var(t > u);
|
|
|
|
case Operators::less_than_equal:
|
|
|
|
case Operators::Opers::less_than_equal:
|
|
|
|
return const_var(t <= u);
|
|
|
|
return const_var(t <= u);
|
|
|
|
case Operators::greater_than_equal:
|
|
|
|
case Operators::Opers::greater_than_equal:
|
|
|
|
return const_var(t >= u);
|
|
|
|
return const_var(t >= u);
|
|
|
|
case Operators::not_equal:
|
|
|
|
case Operators::Opers::not_equal:
|
|
|
|
return const_var(t != u);
|
|
|
|
return const_var(t != u);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
@@ -184,10 +184,10 @@ namespace chaiscript
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (t_oper)
|
|
|
|
switch (t_oper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case Operators::pre_increment:
|
|
|
|
case Operators::Opers::pre_increment:
|
|
|
|
++t;
|
|
|
|
++t;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::pre_decrement:
|
|
|
|
case Operators::Opers::pre_decrement:
|
|
|
|
--t;
|
|
|
|
--t;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@@ -202,20 +202,20 @@ namespace chaiscript
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (t_oper)
|
|
|
|
switch (t_oper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case Operators::assign:
|
|
|
|
case Operators::Opers::assign:
|
|
|
|
t = u;
|
|
|
|
t = u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::assign_product:
|
|
|
|
case Operators::Opers::assign_product:
|
|
|
|
t *= u;
|
|
|
|
t *= u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::assign_sum:
|
|
|
|
case Operators::Opers::assign_sum:
|
|
|
|
t += u;
|
|
|
|
t += u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::assign_quotient:
|
|
|
|
case Operators::Opers::assign_quotient:
|
|
|
|
check_divide_by_zero(u);
|
|
|
|
check_divide_by_zero(u);
|
|
|
|
t /= u;
|
|
|
|
t /= u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::assign_difference:
|
|
|
|
case Operators::Opers::assign_difference:
|
|
|
|
t -= u;
|
|
|
|
t -= u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@@ -230,23 +230,23 @@ namespace chaiscript
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (t_oper)
|
|
|
|
switch (t_oper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case Operators::assign_bitwise_and:
|
|
|
|
case Operators::Opers::assign_bitwise_and:
|
|
|
|
t &= u;
|
|
|
|
t &= u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::assign_bitwise_or:
|
|
|
|
case Operators::Opers::assign_bitwise_or:
|
|
|
|
t |= u;
|
|
|
|
t |= u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::assign_shift_left:
|
|
|
|
case Operators::Opers::assign_shift_left:
|
|
|
|
t <<= u;
|
|
|
|
t <<= u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::assign_shift_right:
|
|
|
|
case Operators::Opers::assign_shift_right:
|
|
|
|
t >>= u;
|
|
|
|
t >>= u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::assign_remainder:
|
|
|
|
case Operators::Opers::assign_remainder:
|
|
|
|
check_divide_by_zero(u);
|
|
|
|
check_divide_by_zero(u);
|
|
|
|
t %= u;
|
|
|
|
t %= u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Operators::assign_bitwise_xor:
|
|
|
|
case Operators::Opers::assign_bitwise_xor:
|
|
|
|
t ^= u;
|
|
|
|
t ^= u;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@@ -260,7 +260,7 @@ namespace chaiscript
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (t_oper)
|
|
|
|
switch (t_oper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case Operators::bitwise_complement:
|
|
|
|
case Operators::Opers::bitwise_complement:
|
|
|
|
return const_var(~t);
|
|
|
|
return const_var(~t);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
@@ -272,18 +272,18 @@ namespace chaiscript
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (t_oper)
|
|
|
|
switch (t_oper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case Operators::shift_left:
|
|
|
|
case Operators::Opers::shift_left:
|
|
|
|
return const_var(t << u);
|
|
|
|
return const_var(t << u);
|
|
|
|
case Operators::shift_right:
|
|
|
|
case Operators::Opers::shift_right:
|
|
|
|
return const_var(t >> u);
|
|
|
|
return const_var(t >> u);
|
|
|
|
case Operators::remainder:
|
|
|
|
case Operators::Opers::remainder:
|
|
|
|
check_divide_by_zero(u);
|
|
|
|
check_divide_by_zero(u);
|
|
|
|
return const_var(t % u);
|
|
|
|
return const_var(t % u);
|
|
|
|
case Operators::bitwise_and:
|
|
|
|
case Operators::Opers::bitwise_and:
|
|
|
|
return const_var(t & u);
|
|
|
|
return const_var(t & u);
|
|
|
|
case Operators::bitwise_or:
|
|
|
|
case Operators::Opers::bitwise_or:
|
|
|
|
return const_var(t | u);
|
|
|
|
return const_var(t | u);
|
|
|
|
case Operators::bitwise_xor:
|
|
|
|
case Operators::Opers::bitwise_xor:
|
|
|
|
return const_var(t ^ u);
|
|
|
|
return const_var(t ^ u);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
@@ -295,9 +295,9 @@ namespace chaiscript
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (t_oper)
|
|
|
|
switch (t_oper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case Operators::unary_minus:
|
|
|
|
case Operators::Opers::unary_minus:
|
|
|
|
return const_var(-t);
|
|
|
|
return const_var(-t);
|
|
|
|
case Operators::unary_plus:
|
|
|
|
case Operators::Opers::unary_plus:
|
|
|
|
return const_var(+t);
|
|
|
|
return const_var(+t);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
@@ -309,14 +309,14 @@ namespace chaiscript
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (t_oper)
|
|
|
|
switch (t_oper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case Operators::sum:
|
|
|
|
case Operators::Opers::sum:
|
|
|
|
return const_var(t + u);
|
|
|
|
return const_var(t + u);
|
|
|
|
case Operators::quotient:
|
|
|
|
case Operators::Opers::quotient:
|
|
|
|
check_divide_by_zero(u);
|
|
|
|
check_divide_by_zero(u);
|
|
|
|
return const_var(t / u);
|
|
|
|
return const_var(t / u);
|
|
|
|
case Operators::product:
|
|
|
|
case Operators::Opers::product:
|
|
|
|
return const_var(t * u);
|
|
|
|
return const_var(t * u);
|
|
|
|
case Operators::difference:
|
|
|
|
case Operators::Opers::difference:
|
|
|
|
return const_var(t - u);
|
|
|
|
return const_var(t - u);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
@@ -328,16 +328,16 @@ namespace chaiscript
|
|
|
|
-> typename std::enable_if<!std::is_floating_point<LHS>::value && !std::is_floating_point<RHS>::value, Boxed_Value>::type
|
|
|
|
-> typename std::enable_if<!std::is_floating_point<LHS>::value && !std::is_floating_point<RHS>::value, Boxed_Value>::type
|
|
|
|
{
|
|
|
|
{
|
|
|
|
typedef typename std::common_type<LHS, RHS>::type common_type;
|
|
|
|
typedef typename std::common_type<LHS, RHS>::type common_type;
|
|
|
|
if (t_oper > Operators::boolean_flag && t_oper < Operators::non_const_flag)
|
|
|
|
if (t_oper > Operators::Opers::boolean_flag && t_oper < Operators::Opers::non_const_flag)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boolean_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
return boolean_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
} else if (t_oper > Operators::non_const_flag && t_oper < Operators::non_const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
} else if (t_oper > Operators::Opers::non_const_flag && t_oper < Operators::Opers::non_const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
return binary_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), get_as_aux<common_type, RHS>(t_rhs), t_lhs);
|
|
|
|
return binary_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), get_as_aux<common_type, RHS>(t_rhs), t_lhs);
|
|
|
|
} else if (t_oper > Operators::non_const_int_flag && t_oper < Operators::const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
} else if (t_oper > Operators::Opers::non_const_int_flag && t_oper < Operators::Opers::const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
return binary_int_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), get_as_aux<common_type, RHS>(t_rhs), t_lhs);
|
|
|
|
return binary_int_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), get_as_aux<common_type, RHS>(t_rhs), t_lhs);
|
|
|
|
} else if (t_oper > Operators::const_int_flag && t_oper < Operators::const_flag) {
|
|
|
|
} else if (t_oper > Operators::Opers::const_int_flag && t_oper < Operators::Opers::const_flag) {
|
|
|
|
return const_binary_int_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
return const_binary_int_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
} else if (t_oper > Operators::const_flag) {
|
|
|
|
} else if (t_oper > Operators::Opers::const_flag) {
|
|
|
|
return const_binary_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
return const_binary_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
@@ -349,12 +349,12 @@ namespace chaiscript
|
|
|
|
-> typename std::enable_if<std::is_floating_point<LHS>::value || std::is_floating_point<RHS>::value, Boxed_Value>::type
|
|
|
|
-> typename std::enable_if<std::is_floating_point<LHS>::value || std::is_floating_point<RHS>::value, Boxed_Value>::type
|
|
|
|
{
|
|
|
|
{
|
|
|
|
typedef typename std::common_type<LHS, RHS>::type common_type;
|
|
|
|
typedef typename std::common_type<LHS, RHS>::type common_type;
|
|
|
|
if (t_oper > Operators::boolean_flag && t_oper < Operators::non_const_flag)
|
|
|
|
if (t_oper > Operators::Opers::boolean_flag && t_oper < Operators::Opers::non_const_flag)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boolean_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
return boolean_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
} else if (t_oper > Operators::non_const_flag && t_oper < Operators::non_const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
} else if (t_oper > Operators::Opers::non_const_flag && t_oper < Operators::Opers::non_const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
return binary_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), get_as_aux<common_type, RHS>(t_rhs), t_lhs);
|
|
|
|
return binary_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), get_as_aux<common_type, RHS>(t_rhs), t_lhs);
|
|
|
|
} else if (t_oper > Operators::const_flag) {
|
|
|
|
} else if (t_oper > Operators::Opers::const_flag) {
|
|
|
|
return const_binary_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
return const_binary_go(t_oper, get_as_aux<common_type, LHS>(t_lhs), get_as_aux<common_type, RHS>(t_rhs));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
@@ -366,11 +366,11 @@ namespace chaiscript
|
|
|
|
static auto go(Operators::Opers t_oper, const Boxed_Value &t_lhs)
|
|
|
|
static auto go(Operators::Opers t_oper, const Boxed_Value &t_lhs)
|
|
|
|
-> typename std::enable_if<!std::is_floating_point<LHS>::value, Boxed_Value>::type
|
|
|
|
-> typename std::enable_if<!std::is_floating_point<LHS>::value, Boxed_Value>::type
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (t_oper > Operators::non_const_flag && t_oper < Operators::non_const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
if (t_oper > Operators::Opers::non_const_flag && t_oper < Operators::Opers::non_const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
return unary_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), t_lhs);
|
|
|
|
return unary_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), t_lhs);
|
|
|
|
} else if (t_oper > Operators::const_int_flag && t_oper < Operators::const_flag) {
|
|
|
|
} else if (t_oper > Operators::Opers::const_int_flag && t_oper < Operators::Opers::const_flag) {
|
|
|
|
return const_unary_int_go(t_oper, *static_cast<const LHS *>(t_lhs.get_const_ptr()));
|
|
|
|
return const_unary_int_go(t_oper, *static_cast<const LHS *>(t_lhs.get_const_ptr()));
|
|
|
|
} else if (t_oper > Operators::const_flag) {
|
|
|
|
} else if (t_oper > Operators::Opers::const_flag) {
|
|
|
|
return const_unary_go(t_oper, *static_cast<const LHS *>(t_lhs.get_const_ptr()));
|
|
|
|
return const_unary_go(t_oper, *static_cast<const LHS *>(t_lhs.get_const_ptr()));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
@@ -381,9 +381,9 @@ namespace chaiscript
|
|
|
|
static auto go(Operators::Opers t_oper, const Boxed_Value &t_lhs)
|
|
|
|
static auto go(Operators::Opers t_oper, const Boxed_Value &t_lhs)
|
|
|
|
-> typename std::enable_if<std::is_floating_point<LHS>::value, Boxed_Value>::type
|
|
|
|
-> typename std::enable_if<std::is_floating_point<LHS>::value, Boxed_Value>::type
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (t_oper > Operators::non_const_flag && t_oper < Operators::non_const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
if (t_oper > Operators::Opers::non_const_flag && t_oper < Operators::Opers::non_const_int_flag && !t_lhs.is_const() && !t_lhs.is_return_value()) {
|
|
|
|
return unary_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), t_lhs);
|
|
|
|
return unary_go(t_oper, *static_cast<LHS *>(t_lhs.get_ptr()), t_lhs);
|
|
|
|
} else if (t_oper > Operators::const_flag) {
|
|
|
|
} else if (t_oper > Operators::Opers::const_flag) {
|
|
|
|
return const_unary_go(t_oper, *static_cast<const LHS *>(t_lhs.get_const_ptr()));
|
|
|
|
return const_unary_go(t_oper, *static_cast<const LHS *>(t_lhs.get_const_ptr()));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
|
throw chaiscript::detail::exception::bad_any_cast();
|
|
|
@@ -647,67 +647,67 @@ namespace chaiscript
|
|
|
|
|
|
|
|
|
|
|
|
bool operator==(const Boxed_Number &t_rhs) const
|
|
|
|
bool operator==(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::equals, this->bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::equals, this->bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool operator<(const Boxed_Number &t_rhs) const
|
|
|
|
bool operator<(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::less_than, this->bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::less_than, this->bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool operator>(const Boxed_Number &t_rhs) const
|
|
|
|
bool operator>(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::greater_than, this->bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::greater_than, this->bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool operator>=(const Boxed_Number &t_rhs) const
|
|
|
|
bool operator>=(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::greater_than_equal, this->bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::greater_than_equal, this->bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool operator<=(const Boxed_Number &t_rhs) const
|
|
|
|
bool operator<=(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::less_than_equal, this->bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::less_than_equal, this->bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool operator!=(const Boxed_Number &t_rhs) const
|
|
|
|
bool operator!=(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::not_equal, this->bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::not_equal, this->bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator--()
|
|
|
|
Boxed_Number operator--()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::pre_decrement, this->bv);
|
|
|
|
return oper(Operators::Opers::pre_decrement, this->bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator++()
|
|
|
|
Boxed_Number operator++()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::pre_increment, this->bv);
|
|
|
|
return oper(Operators::Opers::pre_increment, this->bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator+(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator+(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::sum, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::sum, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator+() const
|
|
|
|
Boxed_Number operator+() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::unary_plus, this->bv);
|
|
|
|
return oper(Operators::Opers::unary_plus, this->bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator-() const
|
|
|
|
Boxed_Number operator-() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::unary_minus, this->bv);
|
|
|
|
return oper(Operators::Opers::unary_minus, this->bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator-(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator-(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::difference, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::difference, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator&=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator&=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_bitwise_and, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_bitwise_and, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void validate_boxed_number(const Boxed_Value &v)
|
|
|
|
static void validate_boxed_number(const Boxed_Value &v)
|
|
|
@@ -735,255 +735,255 @@ namespace chaiscript
|
|
|
|
// cppcheck-suppress operatorEq
|
|
|
|
// cppcheck-suppress operatorEq
|
|
|
|
Boxed_Number operator=(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator=(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator|=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator|=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_bitwise_or, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_bitwise_or, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator^=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator^=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_bitwise_xor, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_bitwise_xor, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator%=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator%=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_remainder, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_remainder, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator<<=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator<<=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_shift_left, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_shift_left, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator>>=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator>>=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_shift_right, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_shift_right, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator&(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator&(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::bitwise_and, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::bitwise_and, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator~() const
|
|
|
|
Boxed_Number operator~() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::bitwise_complement, this->bv);
|
|
|
|
return oper(Operators::Opers::bitwise_complement, this->bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator^(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator^(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::bitwise_xor, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::bitwise_xor, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator|(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator|(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::bitwise_or, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::bitwise_or, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator*=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator*=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_product, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_product, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Boxed_Number operator/=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator/=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_quotient, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_quotient, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Boxed_Number operator+=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator+=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_sum, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_sum, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Boxed_Number operator-=(const Boxed_Number &t_rhs)
|
|
|
|
Boxed_Number operator-=(const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_difference, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_difference, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator/(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator/(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::quotient, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::quotient, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator<<(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator<<(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::shift_left, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::shift_left, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator*(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator*(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::product, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::product, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator%(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator%(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::remainder, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::remainder, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boxed_Number operator>>(const Boxed_Number &t_rhs) const
|
|
|
|
Boxed_Number operator>>(const Boxed_Number &t_rhs) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::shift_right, this->bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::shift_right, this->bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool equals(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static bool equals(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::equals, t_lhs.bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::equals, t_lhs.bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool less_than(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static bool less_than(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::less_than, t_lhs.bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::less_than, t_lhs.bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool greater_than(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static bool greater_than(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::greater_than, t_lhs.bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::greater_than, t_lhs.bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool greater_than_equal(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static bool greater_than_equal(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::greater_than_equal, t_lhs.bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::greater_than_equal, t_lhs.bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool less_than_equal(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static bool less_than_equal(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::less_than_equal, t_lhs.bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::less_than_equal, t_lhs.bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool not_equal(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static bool not_equal(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return boxed_cast<bool>(oper(Operators::not_equal, t_lhs.bv, t_rhs.bv));
|
|
|
|
return boxed_cast<bool>(oper(Operators::Opers::not_equal, t_lhs.bv, t_rhs.bv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number pre_decrement(Boxed_Number t_lhs)
|
|
|
|
static Boxed_Number pre_decrement(Boxed_Number t_lhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::pre_decrement, t_lhs.bv);
|
|
|
|
return oper(Operators::Opers::pre_decrement, t_lhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number pre_increment(Boxed_Number t_lhs)
|
|
|
|
static Boxed_Number pre_increment(Boxed_Number t_lhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::pre_increment, t_lhs.bv);
|
|
|
|
return oper(Operators::Opers::pre_increment, t_lhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number sum(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number sum(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::sum, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::sum, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number unary_plus(const Boxed_Number &t_lhs)
|
|
|
|
static const Boxed_Number unary_plus(const Boxed_Number &t_lhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::unary_plus, t_lhs.bv);
|
|
|
|
return oper(Operators::Opers::unary_plus, t_lhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number unary_minus(const Boxed_Number &t_lhs)
|
|
|
|
static const Boxed_Number unary_minus(const Boxed_Number &t_lhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::unary_minus, t_lhs.bv);
|
|
|
|
return oper(Operators::Opers::unary_minus, t_lhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number difference(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number difference(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::difference, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::difference, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign_bitwise_and(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_bitwise_and(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_bitwise_and, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_bitwise_and, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign_bitwise_or(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_bitwise_or(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_bitwise_or, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_bitwise_or, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign_bitwise_xor(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_bitwise_xor(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_bitwise_xor, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_bitwise_xor, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign_remainder(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_remainder(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_remainder, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_remainder, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign_shift_left(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_shift_left(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_shift_left, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_shift_left, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign_shift_right(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_shift_right(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_shift_right, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_shift_right, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number bitwise_and(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number bitwise_and(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::bitwise_and, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::bitwise_and, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number bitwise_complement(const Boxed_Number &t_lhs)
|
|
|
|
static const Boxed_Number bitwise_complement(const Boxed_Number &t_lhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::bitwise_complement, t_lhs.bv, Boxed_Value(0));
|
|
|
|
return oper(Operators::Opers::bitwise_complement, t_lhs.bv, Boxed_Value(0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number bitwise_xor(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number bitwise_xor(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::bitwise_xor, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::bitwise_xor, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number bitwise_or(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number bitwise_or(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::bitwise_or, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::bitwise_or, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign_product(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_product(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_product, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_product, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign_quotient(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_quotient(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_quotient, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_quotient, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Boxed_Number assign_sum(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_sum(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_sum, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_sum, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static Boxed_Number assign_difference(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static Boxed_Number assign_difference(Boxed_Number t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::assign_difference, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::assign_difference, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number quotient(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number quotient(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::quotient, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::quotient, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number shift_left(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number shift_left(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::shift_left, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::shift_left, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number product(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number product(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::product, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::product, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number remainder(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number remainder(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::remainder, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::remainder, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const Boxed_Number shift_right(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
static const Boxed_Number shift_right(const Boxed_Number &t_lhs, const Boxed_Number &t_rhs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return oper(Operators::shift_right, t_lhs.bv, t_rhs.bv);
|
|
|
|
return oper(Operators::Opers::shift_right, t_lhs.bv, t_rhs.bv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|