Ticket #8765: move_noexcept.patch

File move_noexcept.patch, 4.1 KB (added by Antony Polukhin, 9 years ago)
  • utility.hpp

     
    3737   template <class T>
    3838   inline typename ::boost::move_detail::enable_if_c
    3939      < enable_move_utility_emulation<T>::value && !has_move_emulation_enabled<T>::value, T&>::type
    40          move(T& x)
     40         move(T& x) BOOST_NOEXCEPT
    4141   {
    4242      return x;
    4343   }
     
    4545   template <class T>
    4646   inline typename ::boost::move_detail::enable_if_c
    4747      < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value, rv<T>&>::type
    48          move(T& x)
     48         move(T& x) BOOST_NOEXCEPT
    4949   {
    5050      return *static_cast<rv<T>* >(::boost::move_detail::addressof(x));
    5151   }
     
    5353   template <class T>
    5454   inline typename ::boost::move_detail::enable_if_c
    5555      < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value, rv<T>&>::type
    56          move(rv<T>& x)
     56         move(rv<T>& x) BOOST_NOEXCEPT
    5757   {
    5858      return x;
    5959   }
     
    6767   template <class T>
    6868   inline typename ::boost::move_detail::enable_if_c
    6969      < enable_move_utility_emulation<T>::value && ::boost::move_detail::is_rv<T>::value, T &>::type
    70          forward(const typename ::boost::move_detail::identity<T>::type &x)
     70         forward(const typename ::boost::move_detail::identity<T>::type &x) BOOST_NOEXCEPT
    7171   {
    7272      return const_cast<T&>(x);
    7373   }
     
    7575   template <class T>
    7676   inline typename ::boost::move_detail::enable_if_c
    7777      < enable_move_utility_emulation<T>::value && !::boost::move_detail::is_rv<T>::value, const T &>::type
    78       forward(const typename ::boost::move_detail::identity<T>::type &x)
     78      forward(const typename ::boost::move_detail::identity<T>::type &x) BOOST_NOEXCEPT
    7979   {
    8080      return x;
    8181   }
     
    123123         //! in compilers with rvalue references. For other compilers converts T & into
    124124         //! <i>::boost::rv<T> &</i> so that move emulation is activated.
    125125         template <class T>
    126          rvalue_reference move (input_reference);
     126         rvalue_reference move (input_reference) noexcept;
    127127
    128128      #elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
    129129
    130130         //Old move approach, lvalues could bind to rvalue references
    131131         template <class T>
    132          inline typename remove_reference<T>::type && move(T&& t)
     132         inline typename remove_reference<T>::type && move(T&& t) BOOST_NOEXCEPT
    133133         {  return t;   }
    134134
    135135      #else //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
    136136
    137137         template <class T>
    138          inline typename remove_reference<T>::type && move(T&& t)
     138         inline typename remove_reference<T>::type && move(T&& t) BOOST_NOEXCEPT
    139139         { return static_cast<typename remove_reference<T>::type &&>(t); }
    140140
    141141      #endif   //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
     
    159159         //!   ::boost::rv<T> &
    160160         //!
    161161         //! * Else, output_reference is equal to input_reference.
    162          template <class T> output_reference forward(input_reference);
     162         template <class T> output_reference forward(input_reference) noexcept;
    163163      #elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
    164164
    165165         //Old move approach, lvalues could bind to rvalue references
    166166
    167167         template <class T>
    168          inline T&& forward (typename ::boost::move_detail::identity<T>::type&& t)
     168         inline T&& forward (typename ::boost::move_detail::identity<T>::type&& t) BOOST_NOEXCEPT
    169169         {  return t;   }
    170170
    171171      #else //Old move
     
    178178               move_detail::is_lvalue_reference<T>::value ? move_detail::is_lvalue_reference<U>::value : true>::type * = 0/*
    179179             , typename ::boost::move_detail::enable_if_c<
    180180               move_detail::is_convertible
    181                   <typename remove_reference<U>::type*, typename remove_reference<T>::type*>::value>::type * = 0*/)
     181                  <typename remove_reference<U>::type*, typename remove_reference<T>::type*>::value>::type * = 0*/) BOOST_NOEXCEPT
    182182         { return static_cast<T&&>(t);   }
    183183
    184184      #endif   //BOOST_MOVE_DOXYGEN_INVOKED