Ticket #8057: 8057.patch

File 8057.patch, 4.7 KB (added by viboes, 10 years ago)
  • boost/atomic/detail/base.hpp

     
    143143    typedef T value_type;
    144144    typedef lockpool::scoped_lock guard_type;
    145145public:
    146     base_atomic(void) {}
     146    BOOST_CONSTEXPR base_atomic(void) BOOST_NOEXCEPT {}
    147147
    148     explicit base_atomic(const value_type & v)
     148    explicit BOOST_CONSTEXPR base_atomic(const value_type & v) BOOST_NOEXCEPT  : v_(v)
    149149    {
    150         memcpy(&v_, &v, sizeof(value_type));
     150        //memcpy(&v_, &v, sizeof(value_type));
    151151    }
    152152
    153153    void
     
    216216
    217217    BOOST_ATOMIC_DECLARE_BASE_OPERATORS
    218218private:
     219#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
     220    base_atomic(const base_atomic &) = delete;
     221    void operator=(const base_atomic &) = delete;
     222#else
    219223    base_atomic(const base_atomic &) /* = delete */ ;
    220224    void operator=(const base_atomic &) /* = delete */ ;
    221 
     225#endif
    222226    char v_[sizeof(value_type)];
    223227};
    224228
     
    230234    typedef T difference_type;
    231235    typedef lockpool::scoped_lock guard_type;
    232236public:
    233     explicit base_atomic(value_type v) : v_(v) {}
    234     base_atomic(void) {}
     237    explicit BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
     238    BOOST_CONSTEXPR base_atomic(void) BOOST_NOEXCEPT {}
    235239
    236240    void
    237241    store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
     
    342346
    343347    BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
    344348private:
     349#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
     350    base_atomic(const base_atomic &) = delete;
     351    void operator=(const base_atomic &) = delete;
     352#else
    345353    base_atomic(const base_atomic &) /* = delete */ ;
    346354    void operator=(const base_atomic &) /* = delete */ ;
     355#endif
    347356    value_type v_;
    348357};
    349358
     
    434443
    435444    BOOST_ATOMIC_DECLARE_POINTER_OPERATORS
    436445private:
    437     base_atomic(const base_atomic  &) /* = delete */ ;
     446#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
     447    base_atomic(const base_atomic &) = delete;
     448    void operator=(const base_atomic &) = delete;
     449#else
     450    base_atomic(const base_atomic &) /* = delete */ ;
    438451    void operator=(const base_atomic &) /* = delete */ ;
     452#endif
    439453    value_type v_;
    440454};
    441455
     
    446460    typedef void * value_type;
    447461    typedef lockpool::scoped_lock guard_type;
    448462public:
    449     explicit base_atomic(value_type v) : v_(v) {}
    450     base_atomic(void) {}
     463    explicit BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
     464    BOOST_CONSTEXPR base_atomic(void) BOOST_NOEXCEPT {}
    451465
    452466    void
    453467    store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
  • boost/atomic/detail/gcc-x86.hpp

     
    525525    typedef T value_type;
    526526    typedef T difference_type;
    527527public:
    528     explicit base_atomic(value_type v) : v_(v) {}
    529     base_atomic(void) {}
     528    explicit BOOST_CONSTEXPR base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
     529    BOOST_CONSTEXPR base_atomic(void) BOOST_NOEXCEPT {}
    530530
    531531    void
    532532    store(value_type v, memory_order order = memory_order_seq_cst) volatile
     
    651651
    652652    BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
    653653private:
     654#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
     655    base_atomic(const base_atomic &) = delete;
     656    void operator=(const base_atomic &) = delete;
     657#else
    654658    base_atomic(const base_atomic &) /* = delete */ ;
    655659    void operator=(const base_atomic &) /* = delete */ ;
     660#endif
    656661    value_type v_;
    657662};
    658663
  • boost/atomic/atomic.hpp

     
    8888    typedef T value_type;
    8989    typedef atomics::detail::base_atomic<T, typename atomics::detail::classify<T>::type, atomics::detail::storage_size_of<T>::value, boost::is_signed<T>::value > super;
    9090public:
    91     atomic(void) : super() {}
    92     explicit atomic(const value_type & v) : super(v) {}
     91    BOOST_CONSTEXPR atomic(void) BOOST_NOEXCEPT: super() {}
     92    explicit BOOST_CONSTEXPR atomic(const value_type & v) BOOST_NOEXCEPT: super(v) {}
    9393
    9494    atomic & operator=(value_type v) volatile
    9595    {
    9696        super::operator=(v);
    9797        return *const_cast<atomic *>(this);
    9898    }
     99#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
     100    atomic(const atomic &)  =delete;
     101    atomic & operator=(const atomic &) =delete;
     102#else
    99103private:
    100104    atomic(const atomic &) /* =delete */ ;
    101105    atomic & operator=(const atomic &) /* =delete */ ;
     106#endif
    102107};
    103108
     109
    104110typedef atomic<char> atomic_char;
    105111typedef atomic<unsigned char> atomic_uchar;
    106112typedef atomic<signed char> atomic_schar;