From 84e17b8d06b3e4223a591d15fd0a393d2afab154 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 16 Jul 2012 22:24:25 -0600 Subject: [PATCH] Port Boxed_Number enhancements from mgee to C++11 branch. #53 --- .../chaiscript/dispatchkit/boxed_number.hpp | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/include/chaiscript/dispatchkit/boxed_number.hpp b/include/chaiscript/dispatchkit/boxed_number.hpp index c38f751..8f7401b 100644 --- a/include/chaiscript/dispatchkit/boxed_number.hpp +++ b/include/chaiscript/dispatchkit/boxed_number.hpp @@ -9,6 +9,7 @@ #include "boxed_value.hpp" #include "../language/chaiscript_algebraic.hpp" +#include namespace chaiscript { @@ -354,24 +355,24 @@ namespace chaiscript return get_as_aux(); } else if (inp_ == typeid(unsigned long)) { return get_as_aux(); - } else if (inp_ == typeid(boost::int8_t)) { - return get_as_aux(); - } else if (inp_ == typeid(boost::int16_t)) { - return get_as_aux(); - } else if (inp_ == typeid(boost::int32_t)) { - return get_as_aux(); - } else if (inp_ == typeid(boost::int64_t)) { - return get_as_aux(); - } else if (inp_ == typeid(boost::uint8_t)) { - return get_as_aux(); - } else if (inp_ == typeid(boost::uint16_t)) { - return get_as_aux(); - } else if (inp_ == typeid(boost::uint32_t)) { - return get_as_aux(); - } else if (inp_ == typeid(boost::uint64_t)) { - return get_as_aux(); + } else if (inp_ == typeid(std::int8_t)) { + return get_as_aux(); + } else if (inp_ == typeid(std::int16_t)) { + return get_as_aux(); + } else if (inp_ == typeid(std::int32_t)) { + return get_as_aux(); + } else if (inp_ == typeid(std::int64_t)) { + return get_as_aux(); + } else if (inp_ == typeid(std::uint8_t)) { + return get_as_aux(); + } else if (inp_ == typeid(std::uint16_t)) { + return get_as_aux(); + } else if (inp_ == typeid(std::uint32_t)) { + return get_as_aux(); + } else if (inp_ == typeid(std::uint64_t)) { + return get_as_aux(); } else { - throw boost::bad_any_cast(); + throw chaiscript::detail::exception::bad_any_cast(); } } @@ -395,24 +396,24 @@ namespace chaiscript return to_string_aux(bv); } else if (inp_ == typeid(unsigned long)) { return to_string_aux(bv); - } else if (inp_ == typeid(boost::int8_t)) { - return to_string_aux(Boxed_Value(get_as_aux())); - } else if (inp_ == typeid(boost::int16_t)) { - return to_string_aux(bv); - } else if (inp_ == typeid(boost::int32_t)) { - return to_string_aux(bv); - } else if (inp_ == typeid(boost::int64_t)) { - return to_string_aux(bv); - } else if (inp_ == typeid(boost::uint8_t)) { - return to_string_aux(Boxed_Value(get_as_aux())); - } else if (inp_ == typeid(boost::uint16_t)) { - return to_string_aux(bv); - } else if (inp_ == typeid(boost::uint32_t)) { - return to_string_aux(bv); - } else if (inp_ == typeid(boost::uint64_t)) { - return to_string_aux(bv); + } else if (inp_ == typeid(std::int8_t)) { + return to_string_aux(Boxed_Value(get_as_aux())); + } else if (inp_ == typeid(std::int16_t)) { + return to_string_aux(bv); + } else if (inp_ == typeid(std::int32_t)) { + return to_string_aux(bv); + } else if (inp_ == typeid(std::int64_t)) { + return to_string_aux(bv); + } else if (inp_ == typeid(std::uint8_t)) { + return to_string_aux(Boxed_Value(get_as_aux())); + } else if (inp_ == typeid(std::uint16_t)) { + return to_string_aux(bv); + } else if (inp_ == typeid(std::uint32_t)) { + return to_string_aux(bv); + } else if (inp_ == typeid(std::uint64_t)) { + return to_string_aux(bv); } else { - throw boost::bad_any_cast(); + throw chaiscript::detail::exception::bad_any_cast(); } }