diff --git a/include/boost/endian/arithmetic.hpp b/include/boost/endian/arithmetic.hpp index 3280f3a..f620f7e 100644 --- a/include/boost/endian/arithmetic.hpp +++ b/include/boost/endian/arithmetic.hpp @@ -177,12 +177,12 @@ namespace endian template -class endian_arithmetic: - public endian_buffer +class endian_arithmetic { private: - typedef endian_buffer inherited; + typedef endian_buffer buffer_type; + buffer_type buf_; public: @@ -192,7 +192,7 @@ public: endian_arithmetic() BOOST_ENDIAN_DEFAULT_CONSTRUCT - BOOST_ENDIAN_EXPLICIT_OPT endian_arithmetic( T val ) BOOST_NOEXCEPT: inherited( val ) + BOOST_ENDIAN_EXPLICIT_OPT endian_arithmetic( T val ) BOOST_NOEXCEPT: buf_( val ) { } @@ -200,15 +200,40 @@ public: endian_arithmetic& operator=( T val ) BOOST_NOEXCEPT { - inherited::operator=( val ); + buf_ = val; return *this; } + value_type value() const BOOST_NOEXCEPT + { + return buf_.value(); + } + + unsigned char const * data() const BOOST_NOEXCEPT + { + return buf_.data(); + } + + unsigned char * data() BOOST_NOEXCEPT + { + return buf_.data(); + } + operator value_type() const BOOST_NOEXCEPT { return this->value(); } + operator buffer_type& () BOOST_NOEXCEPT + { + return buf_; + } + + operator buffer_type const& () BOOST_NOEXCEPT + { + return buf_; + } + // operators T operator+() const BOOST_NOEXCEPT