$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r85442 - in branches/release: boost/move libs/move libs/move/doc libs/move/example libs/move/test
From: igaztanaga_at_[hidden]
Date: 2013-08-24 06:34:37
Author: igaztanaga
Date: 2013-08-24 06:34:37 EDT (Sat, 24 Aug 2013)
New Revision: 85442
URL: http://svn.boost.org/trac/boost/changeset/85442
Log:
First Move merge for 1.55
Properties modified: 
   branches/release/boost/move/   (props changed)
   branches/release/libs/move/   (props changed)
Text files modified: 
   branches/release/boost/move/algorithm.hpp                  |     1 -                                       
   branches/release/boost/move/core.hpp                       |     7 +++++++                                 
   branches/release/boost/move/traits.hpp                     |    12 ++++++++++--                            
   branches/release/boost/move/utility.hpp                    |    22 +++++++++++-----------                  
   branches/release/libs/move/doc/move.qbk                    |    27 +++++++++++++++++++++------             
   branches/release/libs/move/example/doc_file_descriptor.cpp |    13 +++++++------                           
   branches/release/libs/move/test/move.cpp                   |     1 -                                       
   7 files changed, 56 insertions(+), 27 deletions(-)
Modified: branches/release/boost/move/algorithm.hpp
==============================================================================
--- branches/release/boost/move/algorithm.hpp	Sat Aug 24 04:17:46 2013	(r85441)
+++ branches/release/boost/move/algorithm.hpp	2013-08-24 06:34:37 EDT (Sat, 24 Aug 2013)	(r85442)
@@ -18,7 +18,6 @@
 
 #include <boost/move/utility.hpp>
 #include <boost/move/iterator.hpp>
-#include <boost/move/algorithm.hpp>
 #include <boost/detail/no_exceptions_support.hpp>
 
 #include <algorithm> //copy, copy_backward
Modified: branches/release/boost/move/core.hpp
==============================================================================
--- branches/release/boost/move/core.hpp	Sat Aug 24 04:17:46 2013	(r85441)
+++ branches/release/boost/move/core.hpp	2013-08-24 06:34:37 EDT (Sat, 24 Aug 2013)	(r85442)
@@ -18,17 +18,24 @@
 
 #include <boost/move/detail/config_begin.hpp>
 
+//boost_move_no_copy_constructor_or_assign typedef
+//used to detect noncopyable types for other Boost libraries.
 #ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
    #define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \
       private:\
       TYPE(TYPE &);\
       TYPE& operator=(TYPE &);\
+      public:\
+      typedef int boost_move_no_copy_constructor_or_assign; \
+      private:\
    //
 #else
    #define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \
       public:\
       TYPE(TYPE const &) = delete;\
       TYPE& operator=(TYPE const &) = delete;\
+      public:\
+      typedef int boost_move_no_copy_constructor_or_assign; \
       private:\
    //
 #endif   //BOOST_NO_CXX11_DELETED_FUNCTIONS
Modified: branches/release/boost/move/traits.hpp
==============================================================================
--- branches/release/boost/move/traits.hpp	Sat Aug 24 04:17:46 2013	(r85441)
+++ branches/release/boost/move/traits.hpp	2013-08-24 06:34:37 EDT (Sat, 24 Aug 2013)	(r85442)
@@ -16,6 +16,8 @@
 
 #include <boost/move/detail/config_begin.hpp>
 #include <boost/type_traits/has_trivial_destructor.hpp>
+#include <boost/type_traits/is_nothrow_move_constructible.hpp>
+#include <boost/type_traits/is_nothrow_move_assignable.hpp>
 #include <boost/move/detail/meta_utils.hpp>
 
 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
@@ -38,11 +40,17 @@
    : ::boost::has_trivial_destructor<T>
 {};
 
-//! By default this traits returns false. Classes with non-throwing move constructor
+//! By default this traits returns
+//! <pre>boost::is_nothrow_move_constructible<T>::value && boost::is_nothrow_move_assignable<T>::value </pre>.
+//! Classes with non-throwing move constructor
 //! and assignment can specialize this trait to obtain some performance improvements.
 template <class T>
 struct has_nothrow_move
-   : public ::boost::move_detail::integral_constant<bool, false>
+   : public ::boost::move_detail::integral_constant
+      < bool
+      , boost::is_nothrow_move_constructible<T>::value &&
+        boost::is_nothrow_move_assignable<T>::value
+      >
 {};
 
 namespace move_detail {
Modified: branches/release/boost/move/utility.hpp
==============================================================================
--- branches/release/boost/move/utility.hpp	Sat Aug 24 04:17:46 2013	(r85441)
+++ branches/release/boost/move/utility.hpp	2013-08-24 06:34:37 EDT (Sat, 24 Aug 2013)	(r85442)
@@ -37,7 +37,7 @@
    template <class T>
    inline typename ::boost::move_detail::enable_if_c
       < enable_move_utility_emulation<T>::value && !has_move_emulation_enabled<T>::value, T&>::type
-         move(T& x)
+         move(T& x) BOOST_NOEXCEPT
    {
       return x;
    }
@@ -45,7 +45,7 @@
    template <class T>
    inline typename ::boost::move_detail::enable_if_c
       < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value, rv<T>&>::type
-         move(T& x)
+         move(T& x) BOOST_NOEXCEPT
    {
       return *static_cast<rv<T>* >(::boost::move_detail::addressof(x));
    }
@@ -53,7 +53,7 @@
    template <class T>
    inline typename ::boost::move_detail::enable_if_c
       < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value, rv<T>&>::type
-         move(rv<T>& x)
+         move(rv<T>& x) BOOST_NOEXCEPT
    {
       return x;
    }
@@ -67,7 +67,7 @@
    template <class T>
    inline typename ::boost::move_detail::enable_if_c
       < enable_move_utility_emulation<T>::value && ::boost::move_detail::is_rv<T>::value, T &>::type
-         forward(const typename ::boost::move_detail::identity<T>::type &x)
+         forward(const typename ::boost::move_detail::identity<T>::type &x) BOOST_NOEXCEPT
    {
       return const_cast<T&>(x);
    }
@@ -75,7 +75,7 @@
    template <class T>
    inline typename ::boost::move_detail::enable_if_c
       < enable_move_utility_emulation<T>::value && !::boost::move_detail::is_rv<T>::value, const T &>::type
-      forward(const typename ::boost::move_detail::identity<T>::type &x)
+      forward(const typename ::boost::move_detail::identity<T>::type &x) BOOST_NOEXCEPT
    {
       return x;
    }
@@ -123,19 +123,19 @@
          //! in compilers with rvalue references. For other compilers converts T & into
          //! <i>::boost::rv<T> &</i> so that move emulation is activated.
          template <class T>
-         rvalue_reference move (input_reference);
+         rvalue_reference move(input_reference) noexcept;
 
       #elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
 
          //Old move approach, lvalues could bind to rvalue references
          template <class T>
-         inline typename remove_reference<T>::type && move(T&& t)
+         inline typename remove_reference<T>::type && move(T&& t) BOOST_NOEXCEPT
          {  return t;   }
 
       #else //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
 
          template <class T>
-         inline typename remove_reference<T>::type && move(T&& t)
+         inline typename remove_reference<T>::type && move(T&& t) BOOST_NOEXCEPT
          { return static_cast<typename remove_reference<T>::type &&>(t); }
 
       #endif   //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
@@ -159,13 +159,13 @@
          //!   ::boost::rv<T> &
          //!
          //! * Else, output_reference is equal to input_reference.
-         template <class T> output_reference forward(input_reference);
+         template <class T> output_reference forward(input_reference) noexcept;
       #elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
 
          //Old move approach, lvalues could bind to rvalue references
 
          template <class T>
-         inline T&& forward (typename ::boost::move_detail::identity<T>::type&& t)
+         inline T&& forward(typename ::boost::move_detail::identity<T>::type&& t) BOOST_NOEXCEPT
          {  return t;   }
 
       #else //Old move
@@ -178,7 +178,7 @@
                move_detail::is_lvalue_reference<T>::value ? move_detail::is_lvalue_reference<U>::value : true>::type * = 0/*
              , typename ::boost::move_detail::enable_if_c<
                move_detail::is_convertible
-                  <typename remove_reference<U>::type*, typename remove_reference<T>::type*>::value>::type * = 0*/)
+                  <typename remove_reference<U>::type*, typename remove_reference<T>::type*>::value>::type * = 0*/) BOOST_NOEXCEPT
          { return static_cast<T&&>(t);   }
 
       #endif   //BOOST_MOVE_DOXYGEN_INVOKED
Modified: branches/release/libs/move/doc/move.qbk
==============================================================================
--- branches/release/libs/move/doc/move.qbk	Sat Aug 24 04:17:46 2013	(r85441)
+++ branches/release/libs/move/doc/move.qbk	2013-08-24 06:34:37 EDT (Sat, 24 Aug 2013)	(r85442)
@@ -129,9 +129,12 @@
 
       clone_ptr& operator=(clone_ptr&& p)
       {
-         std::swap(ptr, p.ptr);
-         delete p.ptr;
-         p.ptr = 0;
+         if(this != &p)
+         {
+            std::swap(ptr, p.ptr);
+            delete p.ptr;
+            p.ptr = 0;
+         }
          return *this;
       }
 
@@ -171,7 +174,7 @@
 
 * Put the following macro in the [*private] section:
   [macroref BOOST_COPYABLE_AND_MOVABLE BOOST_COPYABLE_AND_MOVABLE(classname)]
-* Left copy constructor as is.
+* Leave copy constructor as is.
 * Write a copy assignment taking the parameter as
   [macroref BOOST_COPY_ASSIGN_REF BOOST_COPY_ASSIGN_REF(classname)]
 * Write a move constructor and a move assignment taking the parameter as
@@ -787,10 +790,22 @@
 
 [section:release_notes Release Notes]
 
+[section:release_notes_boost_1_55_00 Boost 1.55 Release]
+
+*  Fixed bugs  [@https://svn.boost.org/trac/boost/ticket/7952 #7952],
+               [@https://svn.boost.org/trac/boost/ticket/8764 #8764],
+               [@https://svn.boost.org/trac/boost/ticket/8765 #8765],
+               [@https://svn.boost.org/trac/boost/ticket/8842 #8842],
+               [@https://svn.boost.org/trac/boost/ticket/8979 #8979].
+[endsect]
+
+
 [section:release_notes_boost_1_54_00 Boost 1.54 Release]
 
-*  Fixed bugs [@https://svn.boost.org/trac/boost/ticket/7969 #7969]),
-   [@https://svn.boost.org/trac/boost/ticket/8231 #8231]).
+
+*  Fixed bugs [@https://svn.boost.org/trac/boost/ticket/7969 #7969],
+              [@https://svn.boost.org/trac/boost/ticket/8231 #8231],
+              [@https://svn.boost.org/trac/boost/ticket/8765 #8765].
 
 [endsect]
 
Modified: branches/release/libs/move/example/doc_file_descriptor.cpp
==============================================================================
--- branches/release/libs/move/example/doc_file_descriptor.cpp	Sat Aug 24 04:17:46 2013	(r85441)
+++ branches/release/libs/move/example/doc_file_descriptor.cpp	2013-08-24 06:34:37 EDT (Sat, 24 Aug 2013)	(r85442)
@@ -10,6 +10,7 @@
 //////////////////////////////////////////////////////////////////////////////
 
 #include <boost/move/detail/config_begin.hpp>
+#include <cassert>
 
 //[file_descriptor_def
 
@@ -24,8 +25,8 @@
       return 1;
    }
 
-   void operating_system_close_file(int)
-   {}
+   void operating_system_close_file(int fd)
+   {  (void)fd;   assert(fd != 0); }
    //->
    int os_descr_;
 
@@ -33,12 +34,12 @@
    BOOST_MOVABLE_BUT_NOT_COPYABLE(file_descriptor)
 
    public:
-   explicit file_descriptor(const char *filename = 0)          //Constructor
-      : os_descr_(filename ? operating_system_open_file(filename) : 0)
+   explicit file_descriptor(const char *filename)              //Constructor
+      : os_descr_(operating_system_open_file(filename))
    {  if(!os_descr_) throw std::runtime_error("file not found");  }
 
    ~file_descriptor()                                          //Destructor
-   {  if(!os_descr_)  operating_system_close_file(os_descr_);  }
+   {  if(os_descr_)  operating_system_close_file(os_descr_);  }
 
    file_descriptor(BOOST_RV_REF(file_descriptor) x)            // Move ctor
       :  os_descr_(x.os_descr_)
@@ -46,7 +47,7 @@
 
    file_descriptor& operator=(BOOST_RV_REF(file_descriptor) x) // Move assign
    {
-      if(!os_descr_) operating_system_close_file(os_descr_);
+      if(os_descr_) operating_system_close_file(os_descr_);
       os_descr_   = x.os_descr_;
       x.os_descr_ = 0;
       return *this;
Modified: branches/release/libs/move/test/move.cpp
==============================================================================
--- branches/release/libs/move/test/move.cpp	Sat Aug 24 04:17:46 2013	(r85441)
+++ branches/release/libs/move/test/move.cpp	2013-08-24 06:34:37 EDT (Sat, 24 Aug 2013)	(r85442)
@@ -66,7 +66,6 @@
 {
    #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
    BOOST_STATIC_ASSERT((boost::has_nothrow_move<movable>::value == true));
-   BOOST_STATIC_ASSERT((boost::has_nothrow_move<copyable>::value == false));
    BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled<copyable>::value == false));
    BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled<copyable*>::value == false));
    BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled<int>::value == false));