value& value::operator=(const value& aOther) { switch (aOther.mType) { case CHAR_T: set_char(aOther.mChar); break; case BOOL_T: set_bool(aOther.mBool); break; case UNSIGNED_T: set_unsigned(aOther.mUnsigned); break; case SIGNED_T: set_signed(aOther.mSigned); break; case FLOAT_T: set_float(aOther.mFloat); break; case POINTER_T: set_pointer(aOther.mPointer); break; case STRING_T: set_string(*static_cast<const c_string*>(aOther.mPointer)); break; case ARRAY_T: set_array(*static_cast<const container<value>*>(aOther.mPointer)); break; case OBJECT_T: set_object(*static_cast<const std::map<c_string, value>*>(aOther.mPointer)); break; default: break; } return *this; }
void set(int n) { set_signed(n); }
raw_integer_t(T n, std::size_t prealloc = 0, typename boost::enable_if< boost::is_integral<T> >::type* = 0): length(1), negative(false), changed(false) { if (std::numeric_limits<T>::is_signed) set_signed(n, prealloc); else set_unsigned(n, false, prealloc); }
value::value(int32_t aValue) : mPointer(nullptr), mType(VOID_T) { set_signed(aValue); }