diff --git a/include/boost/optional/detail/old_optional_implementation.hpp b/include/boost/optional/detail/old_optional_implementation.hpp index f2e6718..4e888ed 100644 --- a/include/boost/optional/detail/old_optional_implementation.hpp +++ b/include/boost/optional/detail/old_optional_implementation.hpp @@ -746,12 +746,12 @@ class optional : public optional_detail::optional_base optional ( optional const& rhs ) : base( static_cast(rhs) ) {} #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES - // Creates a deep move of another optional - // Can throw if T::T(T&&) does - optional ( optional && rhs ) - BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value) - : base( boost::move(rhs) ) - {} + // Creates a deep move of another optional + // Can throw if T::T(T&&) does + optional ( optional && rhs ) + BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value) + : base( boost::move(rhs) ) + {} #endif // No-throw (assuming T::~T() doesn't) @@ -819,7 +819,7 @@ class optional : public optional_detail::optional_base #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES // Assigns from another optional (deep-moves the rhs value) optional& operator= ( optional && rhs ) - BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) + BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) { this->assign( static_cast(rhs) ) ; return *this ; @@ -892,7 +892,7 @@ class optional : public optional_detail::optional_base #endif void swap( optional & arg ) - BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) + BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) { // allow for Koenig lookup boost::swap(*this, arg); diff --git a/include/boost/optional/detail/optional_aligned_storage.hpp b/include/boost/optional/detail/optional_aligned_storage.hpp index 4093885..2937349 100644 --- a/include/boost/optional/detail/optional_aligned_storage.hpp +++ b/include/boost/optional/detail/optional_aligned_storage.hpp @@ -44,24 +44,24 @@ class aligned_storage #endif #if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) - // This workaround is supposed to silence GCC warnings about broken strict aliasing rules - T const* ptr_ref() const - { - union { void const* ap_pvoid; T const* as_ptype; } caster = { address() }; - return caster.as_ptype; - } - T * ptr_ref() - { - union { void* ap_pvoid; T* as_ptype; } caster = { address() }; - return caster.as_ptype; - } + // This workaround is supposed to silence GCC warnings about broken strict aliasing rules + T const* ptr_ref() const + { + union { void const* ap_pvoid; T const* as_ptype; } caster = { address() }; + return caster.as_ptype; + } + T * ptr_ref() + { + union { void* ap_pvoid; T* as_ptype; } caster = { address() }; + return caster.as_ptype; + } #else - T const* ptr_ref() const { return static_cast(address()); } - T * ptr_ref() { return static_cast (address()); } + T const* ptr_ref() const { return static_cast(address()); } + T * ptr_ref() { return static_cast (address()); } #endif - T const& ref() const { return *ptr_ref(); } - T & ref() { return *ptr_ref(); } + T const& ref() const { return *ptr_ref(); } + T & ref() { return *ptr_ref(); } } ; diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index a595e20..a75bf90 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -67,7 +67,7 @@ struct in_place_init_t }; const in_place_init_t in_place_init ((in_place_init_t::init_tag())); -// a tag for conditional in-place initialization of contained value +// a tag for conditional in-place initialization of contained value struct in_place_init_if_t { struct init_tag{}; @@ -896,12 +896,12 @@ class optional : public optional_detail::optional_base optional ( optional const& rhs ) : base( static_cast(rhs) ) {} #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES - // Creates a deep move of another optional - // Can throw if T::T(T&&) does - optional ( optional && rhs ) - BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value) - : base( boost::move(rhs) ) - {} + // Creates a deep move of another optional + // Can throw if T::T(T&&) does + optional ( optional && rhs ) + BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value) + : base( boost::move(rhs) ) + {} #endif @@ -910,7 +910,7 @@ class optional : public optional_detail::optional_base ~optional() {} #endif - + #if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION) // Assigns from an expression. See corresponding constructor. // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED @@ -968,7 +968,7 @@ class optional : public optional_detail::optional_base #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES // Assigns from another optional (deep-moves the rhs value) optional& operator= ( optional && rhs ) - BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) + BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) { this->assign( static_cast(rhs) ) ; return *this ; @@ -1112,7 +1112,7 @@ class optional : public optional_detail::optional_base #endif void swap( optional & arg ) - BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) + BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) { // allow for Koenig lookup boost::swap(*this, arg);