Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73164 - sandbox/conversion/boost/conversion/type_traits
From: vicente.botet_at_[hidden]
Date: 2011-07-17 05:22:16


Author: viboes
Date: 2011-07-17 05:22:15 EDT (Sun, 17 Jul 2011)
New Revision: 73164
URL: http://svn.boost.org/trac/boost/changeset/73164

Log:
conversion: added is_move_constructible and is_move_assignable
Added:
   sandbox/conversion/boost/conversion/type_traits/is_move_assignable.hpp (contents, props changed)
   sandbox/conversion/boost/conversion/type_traits/is_move_constructible.hpp (contents, props changed)

Added: sandbox/conversion/boost/conversion/type_traits/is_move_assignable.hpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/boost/conversion/type_traits/is_move_assignable.hpp 2011-07-17 05:22:15 EDT (Sun, 17 Jul 2011)
@@ -0,0 +1,59 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2009-2011. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+/**
+ * @file
+ * @brief Defines the type trait @c is_copy_assignable.
+ */
+
+
+#ifndef BOOST_CONVERSION_TT_IS_MOVE_ASSIGNABLE_HPP
+#define BOOST_CONVERSION_TT_IS_MOVE_ASSIGNABLE_HPP
+
+#include <boost/conversion/type_traits/is_assignable.hpp>
+#include <boost/conversion/type_traits/is_copy_assignable.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/add_lvalue_reference.hpp>
+
+namespace boost {
+
+ /**
+ * States if @c T is move assignable.
+ *
+ * Condition: <c>is_assignable<T&, T&&>::value</c> is @c true.
+ *
+ * @Requires @c T must be a complete type, (possibly cv-qualified) void, or an array of unknown bound.
+ */
+ template <class T>
+ struct is_move_assignable :
+#if ! defined BOOST_NO_RVALUE_REFERENCES
+ is_assignable<T&, T&&>
+#else
+ is_copy_assignable<T>
+#endif
+ {};
+
+#if !defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
+
+ /**
+ * @c is_copy_assignable specialization for reference types.
+ *
+ * Condition: references are always copy assignable.
+ */
+// template <typename T>
+// struct is_move_assignable<T&> : true_type {};
+ template <>
+ struct is_move_assignable<void> : false_type {};
+
+#endif
+}
+
+
+#endif
+

Added: sandbox/conversion/boost/conversion/type_traits/is_move_constructible.hpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/boost/conversion/type_traits/is_move_constructible.hpp 2011-07-17 05:22:15 EDT (Sun, 17 Jul 2011)
@@ -0,0 +1,58 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2009-2011. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+/**
+ * @file
+ * @brief Defines the type trait @c is_move_constructible.
+ */
+
+
+#ifndef BOOST_CONVERSION_TT_IS_MOVE_CONSTRUCTIBLE_HPP
+#define BOOST_CONVERSION_TT_IS_MOVE_CONSTRUCTIBLE_HPP
+
+#include <boost/conversion/type_traits/is_constructible.hpp>
+#include <boost/conversion/type_traits/is_copy_constructible.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/add_rvalue_reference.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+
+namespace boost {
+
+ /**
+ * States if @c T is move constructible.
+ *
+ * Condition: <c>is_constructible<T, T&&>::value</c> is @c true.
+ *
+ * @Requires @c T must be a complete type, (possibly cv-qualified) void, or an array of unknown bound.
+ */
+ template <class T>
+ struct is_move_constructible :
+#if ! defined BOOST_NO_RVALUE_REFERENCES
+ is_constructible<T, typename add_rvalue_reference<T>::type>
+#else
+ is_copy_constructible<T>
+#endif
+ {};
+
+#if !defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
+ template <>
+ struct is_move_constructible<void> : false_type {};
+// template <typename T>
+// struct is_move_constructible<T&> : true_type {};
+// template <typename T>
+// struct is_move_constructible<T[]> : false_type {};
+// template <typename T, std::size_t N>
+// struct is_move_constructible<T[N]> : false_type {};
+#endif
+
+}
+
+
+#endif
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk