diff --git a/include/boost/core/addressof.hpp b/include/boost/core/addressof.hpp index 4407ca5..f7eab06 100644 --- a/include/boost/core/addressof.hpp +++ b/include/boost/core/addressof.hpp @@ -49,20 +49,20 @@ namespace boost { namespace detail { template -class addressof_ref { +class addrof_ref { public: - BOOST_FORCEINLINE addressof_ref(T& o) BOOST_NOEXCEPT + BOOST_FORCEINLINE addrof_ref(T& o) BOOST_NOEXCEPT : o_(o) { } BOOST_FORCEINLINE operator T&() const BOOST_NOEXCEPT { return o_; } private: - addressof_ref& operator=(const addressof_ref&); + addrof_ref& operator=(const addrof_ref&); T& o_; }; template -struct address_of { +struct addrof { static BOOST_FORCEINLINE T* get(T& o, long) BOOST_NOEXCEPT { return reinterpret_cast(& const_cast(reinterpret_cast(o))); @@ -76,38 +76,38 @@ struct address_of { #if !defined(BOOST_NO_CXX11_DECLTYPE) && \ (defined(__INTEL_COMPILER) || \ (defined(__clang__) && !defined(_LIBCPP_VERSION))) -typedef decltype(nullptr) addressof_null_t; +typedef decltype(nullptr) addrof_null_t; #else -typedef std::nullptr_t addressof_null_t; +typedef std::nullptr_t addrof_null_t; #endif template<> -struct address_of { - typedef addressof_null_t type; +struct addrof { + typedef addrof_null_t type; static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT { return &o; } }; template<> -struct address_of { - typedef const addressof_null_t type; +struct addrof { + typedef const addrof_null_t type; static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT { return &o; } }; template<> -struct address_of { - typedef volatile addressof_null_t type; +struct addrof { + typedef volatile addrof_null_t type; static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT { return &o; } }; template<> -struct address_of { - typedef const volatile addressof_null_t type; +struct addrof { + typedef const volatile addrof_null_t type; static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT { return &o; } @@ -127,10 +127,9 @@ addressof(T& o) BOOST_NOEXCEPT { #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) || \ BOOST_WORKAROUND(__SUNPRO_CC, <= 0x5120) - return boost::detail::address_of::get(o, 0); + return boost::detail::addrof::get(o, 0); #else - return boost::detail::address_of:: - get(boost::detail::addressof_ref(o), 0); + return boost::detail::addrof::get(boost::detail::addrof_ref(o), 0); #endif } @@ -138,14 +137,14 @@ addressof(T& o) BOOST_NOEXCEPT namespace detail { template -struct addressof_result { +struct addrof_result { typedef T* type; }; } /* detail */ template -BOOST_FORCEINLINE typename detail::addressof_result::type +BOOST_FORCEINLINE typename boost::detail::addrof_result::type addressof(T (&o)[N]) BOOST_NOEXCEPT { return &o; @@ -171,79 +170,79 @@ const T (*addressof(const T (&o)[N]) BOOST_NOEXCEPT)[N] namespace detail { template -T addressof_declval() BOOST_NOEXCEPT; +T addrof_declval() BOOST_NOEXCEPT; template -struct addressof_void { +struct addrof_void { typedef void type; }; template -struct addressof_member_operator { +struct addrof_member_operator { static constexpr bool value = false; }; template -struct addressof_member_operator().operator&())>::type> { +struct addrof_member_operator().operator&())>::type> { static constexpr bool value = true; }; #if BOOST_WORKAROUND(BOOST_INTEL, < 1600) -struct addressof_addressable { }; +struct addrof_addressable { }; -addressof_addressable* -operator&(addressof_addressable&) BOOST_NOEXCEPT; +addrof_addressable* +operator&(addrof_addressable&) BOOST_NOEXCEPT; #endif template -struct addressof_non_member_operator { +struct addrof_non_member_operator { static constexpr bool value = false; }; template -struct addressof_non_member_operator()))>::type> { +struct addrof_non_member_operator()))>::type> { static constexpr bool value = true; }; template -struct addressof_expression { +struct addrof_expression { static constexpr bool value = false; }; template -struct addressof_expression())>::type> { +struct addrof_expression())>::type> { static constexpr bool value = true; }; template -struct addressof_is_constexpr { - static constexpr bool value = addressof_expression::value && - !addressof_member_operator::value && - !addressof_non_member_operator::value; +struct addrof_is_constexpr { + static constexpr bool value = addrof_expression::value && + !addrof_member_operator::value && + !addrof_non_member_operator::value; }; template -struct addressof_if { }; +struct addrof_if { }; template -struct addressof_if { +struct addrof_if { typedef T* type; }; template BOOST_FORCEINLINE -typename addressof_if::value, T>::type +typename addrof_if::value, T>::type addressof(T& o) BOOST_NOEXCEPT { - return address_of::get(addressof_ref(o), 0); + return addrof::get(addrof_ref(o), 0); } template constexpr BOOST_FORCEINLINE -typename addressof_if::value, T>::type +typename addrof_if::value, T>::type addressof(T& o) BOOST_NOEXCEPT { return &o; @@ -255,7 +254,7 @@ template constexpr BOOST_FORCEINLINE T* addressof(T& o) BOOST_NOEXCEPT { - return detail::addressof(o); + return boost::detail::addressof(o); } #endif