mirror of
https://github.com/boostorg/move.git
synced 2025-08-02 13:44:28 +02:00
Merge branch 'develop'
This commit is contained in:
@@ -766,6 +766,7 @@ Many thanks to all boosters that have tested, reviewed and improved the library.
|
||||
|
||||
* Added [macroref BOOST_MOVE_BASE BOOST_MOVE_BASE] utility.
|
||||
* Added [funcref boost::adl_move_swap adl_move_swap] utility.
|
||||
* Reduced dependencies on other Boost libraries to make the library a bit more lightweight.
|
||||
|
||||
[endsect]
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#ifndef BOOST_MOVE_ADL_MOVE_SWAP_HPP
|
||||
#define BOOST_MOVE_ADL_MOVE_SWAP_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#ifndef BOOST_MOVE_ALGORITHM_HPP
|
||||
#define BOOST_MOVE_ALGORITHM_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
@@ -16,11 +16,12 @@
|
||||
#ifndef BOOST_MOVE_CORE_HPP
|
||||
#define BOOST_MOVE_CORE_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
#include <boost/move/detail/workaround.hpp>
|
||||
|
||||
//boost_move_no_copy_constructor_or_assign typedef
|
||||
//used to detect noncopyable types for other Boost libraries.
|
||||
@@ -259,23 +260,6 @@
|
||||
|
||||
#else //BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
//Compiler workaround detection
|
||||
#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) && !defined(__clang__)
|
||||
//Pre-standard rvalue binding rules
|
||||
#define BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
|
||||
#elif defined(_MSC_VER) && (_MSC_VER == 1600)
|
||||
//Standard rvalue binding rules but with some bugs
|
||||
#define BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
|
||||
#define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
|
||||
//Use standard library for MSVC to avoid namespace issues as
|
||||
//some move calls in the STL are not fully qualified.
|
||||
//#define BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE
|
||||
#elif defined(_MSC_VER) && (_MSC_VER == 1700)
|
||||
#define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//! This macro marks a type as movable but not copyable, disabling copy construction
|
||||
//! and assignment. The user will need to write a move constructor/assignment as explained
|
||||
//! in the documentation to fully write a movable but not copyable class.
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#ifndef BOOST_MOVE_DEFAULT_DELETE_HPP_INCLUDED
|
||||
#define BOOST_MOVE_DEFAULT_DELETE_HPP_INCLUDED
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
@@ -13,6 +13,7 @@
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning (push)
|
||||
# pragma warning (disable : 4996) // "function": was declared deprecated (_CRT_SECURE_NO_DEPRECATE/_SCL_SECURE_NO_WARNINGS)
|
||||
# pragma warning (disable : 4324) // structure was padded due to __declspec(align())
|
||||
# pragma warning (disable : 4675) // "function": resolved overload was found by argument-dependent lookup
|
||||
# pragma warning (disable : 4996) // "function": was declared deprecated (_CRT_SECURE_NO_DEPRECATE/_SCL_SECURE_NO_WARNINGS)
|
||||
#endif
|
||||
|
461
include/boost/move/detail/fwd_macros.hpp
Normal file
461
include/boost/move/detail/fwd_macros.hpp
Normal file
@@ -0,0 +1,461 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2014-2014. 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/container for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_MOVE_DETAIL_FWD_MACROS_HPP
|
||||
#define BOOST_MOVE_DETAIL_FWD_MACROS_HPP
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/move/detail/workaround.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace move_detail {
|
||||
|
||||
template <typename T> struct unvoid { typedef T type; };
|
||||
template <> struct unvoid<void> { struct type { }; };
|
||||
template <> struct unvoid<const void> { struct type { }; };
|
||||
|
||||
} //namespace move_detail {
|
||||
} //namespace boost {
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
#if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
|
||||
|
||||
namespace boost {
|
||||
namespace move_detail {
|
||||
|
||||
template<class T>
|
||||
struct mref;
|
||||
|
||||
template<class T>
|
||||
struct mref<T &>
|
||||
{
|
||||
explicit mref(T &t) : t_(t){}
|
||||
T &t_;
|
||||
T & get() { return t_; }
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct mref
|
||||
{
|
||||
explicit mref(T &&t) : t_(t) {}
|
||||
T &t_;
|
||||
T &&get() { return ::boost::move(t_); }
|
||||
};
|
||||
|
||||
} //namespace move_detail {
|
||||
} //namespace boost {
|
||||
|
||||
#endif //BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
|
||||
#endif //!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
//BOOST_MOVE_REPEATN(MACRO)
|
||||
#define BOOST_MOVE_REPEAT0(MACRO)
|
||||
#define BOOST_MOVE_REPEAT1(MACRO) MACRO
|
||||
#define BOOST_MOVE_REPEAT2(MACRO) BOOST_MOVE_REPEAT1(MACRO), MACRO
|
||||
#define BOOST_MOVE_REPEAT3(MACRO) BOOST_MOVE_REPEAT2(MACRO), MACRO
|
||||
#define BOOST_MOVE_REPEAT4(MACRO) BOOST_MOVE_REPEAT3(MACRO), MACRO
|
||||
#define BOOST_MOVE_REPEAT5(MACRO) BOOST_MOVE_REPEAT4(MACRO), MACRO
|
||||
#define BOOST_MOVE_REPEAT6(MACRO) BOOST_MOVE_REPEAT5(MACRO), MACRO
|
||||
#define BOOST_MOVE_REPEAT7(MACRO) BOOST_MOVE_REPEAT6(MACRO), MACRO
|
||||
#define BOOST_MOVE_REPEAT8(MACRO) BOOST_MOVE_REPEAT7(MACRO), MACRO
|
||||
#define BOOST_MOVE_REPEAT9(MACRO) BOOST_MOVE_REPEAT8(MACRO), MACRO
|
||||
|
||||
//BOOST_MOVE_FWDN
|
||||
#define BOOST_MOVE_FWD0
|
||||
#define BOOST_MOVE_FWD1 ::boost::forward<P0>(p0)
|
||||
#define BOOST_MOVE_FWD2 BOOST_MOVE_FWD1, ::boost::forward<P1>(p1)
|
||||
#define BOOST_MOVE_FWD3 BOOST_MOVE_FWD2, ::boost::forward<P2>(p2)
|
||||
#define BOOST_MOVE_FWD4 BOOST_MOVE_FWD3, ::boost::forward<P3>(p3)
|
||||
#define BOOST_MOVE_FWD5 BOOST_MOVE_FWD4, ::boost::forward<P4>(p4)
|
||||
#define BOOST_MOVE_FWD6 BOOST_MOVE_FWD5, ::boost::forward<P5>(p5)
|
||||
#define BOOST_MOVE_FWD7 BOOST_MOVE_FWD6, ::boost::forward<P6>(p6)
|
||||
#define BOOST_MOVE_FWD8 BOOST_MOVE_FWD7, ::boost::forward<P7>(p7)
|
||||
#define BOOST_MOVE_FWD9 BOOST_MOVE_FWD8, ::boost::forward<P8>(p8)
|
||||
|
||||
//BOOST_MOVE_FWDQN
|
||||
#define BOOST_MOVE_FWDQ0
|
||||
#define BOOST_MOVE_FWDQ1 ::boost::forward<Q0>(q0)
|
||||
#define BOOST_MOVE_FWDQ2 BOOST_MOVE_FWDQ1, ::boost::forward<Q1>(q1)
|
||||
#define BOOST_MOVE_FWDQ3 BOOST_MOVE_FWDQ2, ::boost::forward<Q2>(q2)
|
||||
#define BOOST_MOVE_FWDQ4 BOOST_MOVE_FWDQ3, ::boost::forward<Q3>(q3)
|
||||
#define BOOST_MOVE_FWDQ5 BOOST_MOVE_FWDQ4, ::boost::forward<Q4>(q4)
|
||||
#define BOOST_MOVE_FWDQ6 BOOST_MOVE_FWDQ5, ::boost::forward<Q5>(q5)
|
||||
#define BOOST_MOVE_FWDQ7 BOOST_MOVE_FWDQ6, ::boost::forward<Q6>(q6)
|
||||
#define BOOST_MOVE_FWDQ8 BOOST_MOVE_FWDQ7, ::boost::forward<Q7>(q7)
|
||||
#define BOOST_MOVE_FWDQ9 BOOST_MOVE_FWDQ8, ::boost::forward<Q8>(q8)
|
||||
|
||||
//BOOST_MOVE_ARGN
|
||||
#define BOOST_MOVE_ARG0
|
||||
#define BOOST_MOVE_ARG1 p0
|
||||
#define BOOST_MOVE_ARG2 BOOST_MOVE_ARG1, p1
|
||||
#define BOOST_MOVE_ARG3 BOOST_MOVE_ARG2, p2
|
||||
#define BOOST_MOVE_ARG4 BOOST_MOVE_ARG3, p3
|
||||
#define BOOST_MOVE_ARG5 BOOST_MOVE_ARG4, p4
|
||||
#define BOOST_MOVE_ARG6 BOOST_MOVE_ARG5, p5
|
||||
#define BOOST_MOVE_ARG7 BOOST_MOVE_ARG6, p6
|
||||
#define BOOST_MOVE_ARG8 BOOST_MOVE_ARG7, p7
|
||||
#define BOOST_MOVE_ARG9 BOOST_MOVE_ARG8, p8
|
||||
|
||||
//BOOST_MOVE_DECLVALN
|
||||
#define BOOST_MOVE_DECLVAL0
|
||||
#define BOOST_MOVE_DECLVAL1 ::boost::move_detail::declval<P0>()
|
||||
#define BOOST_MOVE_DECLVAL2 BOOST_MOVE_DECLVAL1, ::boost::move_detail::declval<P1>()
|
||||
#define BOOST_MOVE_DECLVAL3 BOOST_MOVE_DECLVAL2, ::boost::move_detail::declval<P2>()
|
||||
#define BOOST_MOVE_DECLVAL4 BOOST_MOVE_DECLVAL3, ::boost::move_detail::declval<P3>()
|
||||
#define BOOST_MOVE_DECLVAL5 BOOST_MOVE_DECLVAL4, ::boost::move_detail::declval<P4>()
|
||||
#define BOOST_MOVE_DECLVAL6 BOOST_MOVE_DECLVAL5, ::boost::move_detail::declval<P5>()
|
||||
#define BOOST_MOVE_DECLVAL7 BOOST_MOVE_DECLVAL6, ::boost::move_detail::declval<P6>()
|
||||
#define BOOST_MOVE_DECLVAL8 BOOST_MOVE_DECLVAL7, ::boost::move_detail::declval<P7>()
|
||||
#define BOOST_MOVE_DECLVAL9 BOOST_MOVE_DECLVAL8, ::boost::move_detail::declval<P8>()
|
||||
|
||||
#ifdef BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
|
||||
#define BOOST_MOVE_MREF(T) ::boost::move_detail::mref<T>
|
||||
#define BOOST_MOVE_MFWD(N) ::boost::forward<P##N>(this->m_p##N.get())
|
||||
#else
|
||||
#define BOOST_MOVE_MREF(T) BOOST_FWD_REF(T)
|
||||
#define BOOST_MOVE_MFWD(N) ::boost::forward<P##N>(this->m_p##N)
|
||||
#endif
|
||||
#define BOOST_MOVE_MITFWD(N) *this->m_p##N
|
||||
#define BOOST_MOVE_MINC(N) ++this->m_p##N
|
||||
|
||||
//BOOST_MOVE_MFWDN
|
||||
#define BOOST_MOVE_MFWD0
|
||||
#define BOOST_MOVE_MFWD1 BOOST_MOVE_MFWD(0)
|
||||
#define BOOST_MOVE_MFWD2 BOOST_MOVE_MFWD1, BOOST_MOVE_MFWD(1)
|
||||
#define BOOST_MOVE_MFWD3 BOOST_MOVE_MFWD2, BOOST_MOVE_MFWD(2)
|
||||
#define BOOST_MOVE_MFWD4 BOOST_MOVE_MFWD3, BOOST_MOVE_MFWD(3)
|
||||
#define BOOST_MOVE_MFWD5 BOOST_MOVE_MFWD4, BOOST_MOVE_MFWD(4)
|
||||
#define BOOST_MOVE_MFWD6 BOOST_MOVE_MFWD5, BOOST_MOVE_MFWD(5)
|
||||
#define BOOST_MOVE_MFWD7 BOOST_MOVE_MFWD6, BOOST_MOVE_MFWD(6)
|
||||
#define BOOST_MOVE_MFWD8 BOOST_MOVE_MFWD7, BOOST_MOVE_MFWD(7)
|
||||
#define BOOST_MOVE_MFWD9 BOOST_MOVE_MFWD8, BOOST_MOVE_MFWD(8)
|
||||
|
||||
//BOOST_MOVE_MINCN
|
||||
#define BOOST_MOVE_MINC0
|
||||
#define BOOST_MOVE_MINC1 BOOST_MOVE_MINC(0)
|
||||
#define BOOST_MOVE_MINC2 BOOST_MOVE_MINC1, BOOST_MOVE_MINC(1)
|
||||
#define BOOST_MOVE_MINC3 BOOST_MOVE_MINC2, BOOST_MOVE_MINC(2)
|
||||
#define BOOST_MOVE_MINC4 BOOST_MOVE_MINC3, BOOST_MOVE_MINC(3)
|
||||
#define BOOST_MOVE_MINC5 BOOST_MOVE_MINC4, BOOST_MOVE_MINC(4)
|
||||
#define BOOST_MOVE_MINC6 BOOST_MOVE_MINC5, BOOST_MOVE_MINC(5)
|
||||
#define BOOST_MOVE_MINC7 BOOST_MOVE_MINC6, BOOST_MOVE_MINC(6)
|
||||
#define BOOST_MOVE_MINC8 BOOST_MOVE_MINC7, BOOST_MOVE_MINC(7)
|
||||
#define BOOST_MOVE_MINC9 BOOST_MOVE_MINC8, BOOST_MOVE_MINC(8)
|
||||
|
||||
//BOOST_MOVE_MITFWDN
|
||||
#define BOOST_MOVE_MITFWD0
|
||||
#define BOOST_MOVE_MITFWD1 BOOST_MOVE_MITFWD(0)
|
||||
#define BOOST_MOVE_MITFWD2 BOOST_MOVE_MITFWD1, BOOST_MOVE_MITFWD(1)
|
||||
#define BOOST_MOVE_MITFWD3 BOOST_MOVE_MITFWD2, BOOST_MOVE_MITFWD(2)
|
||||
#define BOOST_MOVE_MITFWD4 BOOST_MOVE_MITFWD3, BOOST_MOVE_MITFWD(3)
|
||||
#define BOOST_MOVE_MITFWD5 BOOST_MOVE_MITFWD4, BOOST_MOVE_MITFWD(4)
|
||||
#define BOOST_MOVE_MITFWD6 BOOST_MOVE_MITFWD5, BOOST_MOVE_MITFWD(5)
|
||||
#define BOOST_MOVE_MITFWD7 BOOST_MOVE_MITFWD6, BOOST_MOVE_MITFWD(6)
|
||||
#define BOOST_MOVE_MITFWD8 BOOST_MOVE_MITFWD7, BOOST_MOVE_MITFWD(7)
|
||||
#define BOOST_MOVE_MITFWD9 BOOST_MOVE_MITFWD8, BOOST_MOVE_MITFWD(8)
|
||||
|
||||
|
||||
//BOOST_MOVE_FWD_INITN
|
||||
#define BOOST_MOVE_FWD_INIT0
|
||||
#define BOOST_MOVE_FWD_INIT1 m_p0(::boost::forward<P0>(p0))
|
||||
#define BOOST_MOVE_FWD_INIT2 BOOST_MOVE_FWD_INIT1, m_p1(::boost::forward<P1>(p1))
|
||||
#define BOOST_MOVE_FWD_INIT3 BOOST_MOVE_FWD_INIT2, m_p2(::boost::forward<P2>(p2))
|
||||
#define BOOST_MOVE_FWD_INIT4 BOOST_MOVE_FWD_INIT3, m_p3(::boost::forward<P3>(p3))
|
||||
#define BOOST_MOVE_FWD_INIT5 BOOST_MOVE_FWD_INIT4, m_p4(::boost::forward<P4>(p4))
|
||||
#define BOOST_MOVE_FWD_INIT6 BOOST_MOVE_FWD_INIT5, m_p5(::boost::forward<P5>(p5))
|
||||
#define BOOST_MOVE_FWD_INIT7 BOOST_MOVE_FWD_INIT6, m_p6(::boost::forward<P6>(p6))
|
||||
#define BOOST_MOVE_FWD_INIT8 BOOST_MOVE_FWD_INIT7, m_p7(::boost::forward<P7>(p7))
|
||||
#define BOOST_MOVE_FWD_INIT9 BOOST_MOVE_FWD_INIT8, m_p8(::boost::forward<P8>(p8))
|
||||
|
||||
//BOOST_MOVE_VAL_INITN
|
||||
#define BOOST_MOVE_VAL_INIT0
|
||||
#define BOOST_MOVE_VAL_INIT1 m_p0(p0)
|
||||
#define BOOST_MOVE_VAL_INIT2 BOOST_MOVE_VAL_INIT1, m_p1(p1)
|
||||
#define BOOST_MOVE_VAL_INIT3 BOOST_MOVE_VAL_INIT2, m_p2(p2)
|
||||
#define BOOST_MOVE_VAL_INIT4 BOOST_MOVE_VAL_INIT3, m_p3(p3)
|
||||
#define BOOST_MOVE_VAL_INIT5 BOOST_MOVE_VAL_INIT4, m_p4(p4)
|
||||
#define BOOST_MOVE_VAL_INIT6 BOOST_MOVE_VAL_INIT5, m_p5(p5)
|
||||
#define BOOST_MOVE_VAL_INIT7 BOOST_MOVE_VAL_INIT6, m_p6(p6)
|
||||
#define BOOST_MOVE_VAL_INIT8 BOOST_MOVE_VAL_INIT7, m_p7(p7)
|
||||
#define BOOST_MOVE_VAL_INIT9 BOOST_MOVE_VAL_INIT8, m_p8(p8)
|
||||
|
||||
//BOOST_MOVE_UREFN
|
||||
#define BOOST_MOVE_UREF0
|
||||
#define BOOST_MOVE_UREF1 BOOST_FWD_REF(P0) p0
|
||||
#define BOOST_MOVE_UREF2 BOOST_MOVE_UREF1, BOOST_FWD_REF(P1) p1
|
||||
#define BOOST_MOVE_UREF3 BOOST_MOVE_UREF2, BOOST_FWD_REF(P2) p2
|
||||
#define BOOST_MOVE_UREF4 BOOST_MOVE_UREF3, BOOST_FWD_REF(P3) p3
|
||||
#define BOOST_MOVE_UREF5 BOOST_MOVE_UREF4, BOOST_FWD_REF(P4) p4
|
||||
#define BOOST_MOVE_UREF6 BOOST_MOVE_UREF5, BOOST_FWD_REF(P5) p5
|
||||
#define BOOST_MOVE_UREF7 BOOST_MOVE_UREF6, BOOST_FWD_REF(P6) p6
|
||||
#define BOOST_MOVE_UREF8 BOOST_MOVE_UREF7, BOOST_FWD_REF(P7) p7
|
||||
#define BOOST_MOVE_UREF9 BOOST_MOVE_UREF8, BOOST_FWD_REF(P8) p8
|
||||
|
||||
//BOOST_MOVE_VALN
|
||||
#define BOOST_MOVE_VAL0
|
||||
#define BOOST_MOVE_VAL1 P0 p0
|
||||
#define BOOST_MOVE_VAL2 BOOST_MOVE_VAL1, BOOST_FWD_REF(P1) p1
|
||||
#define BOOST_MOVE_VAL3 BOOST_MOVE_VAL2, BOOST_FWD_REF(P2) p2
|
||||
#define BOOST_MOVE_VAL4 BOOST_MOVE_VAL3, BOOST_FWD_REF(P3) p3
|
||||
#define BOOST_MOVE_VAL5 BOOST_MOVE_VAL4, BOOST_FWD_REF(P4) p4
|
||||
#define BOOST_MOVE_VAL6 BOOST_MOVE_VAL5, BOOST_FWD_REF(P5) p5
|
||||
#define BOOST_MOVE_VAL7 BOOST_MOVE_VAL6, BOOST_FWD_REF(P6) p6
|
||||
#define BOOST_MOVE_VAL8 BOOST_MOVE_VAL7, BOOST_FWD_REF(P7) p7
|
||||
#define BOOST_MOVE_VAL9 BOOST_MOVE_VAL8, BOOST_FWD_REF(P8) p8
|
||||
|
||||
//BOOST_MOVE_UREFQN
|
||||
#define BOOST_MOVE_UREFQ0
|
||||
#define BOOST_MOVE_UREFQ1 BOOST_FWD_REF(Q0) q0
|
||||
#define BOOST_MOVE_UREFQ2 BOOST_MOVE_UREFQ1, BOOST_FWD_REF(Q1) q1
|
||||
#define BOOST_MOVE_UREFQ3 BOOST_MOVE_UREFQ2, BOOST_FWD_REF(Q2) q2
|
||||
#define BOOST_MOVE_UREFQ4 BOOST_MOVE_UREFQ3, BOOST_FWD_REF(Q3) q3
|
||||
#define BOOST_MOVE_UREFQ5 BOOST_MOVE_UREFQ4, BOOST_FWD_REF(Q4) q4
|
||||
#define BOOST_MOVE_UREFQ6 BOOST_MOVE_UREFQ5, BOOST_FWD_REF(Q5) q5
|
||||
#define BOOST_MOVE_UREFQ7 BOOST_MOVE_UREFQ6, BOOST_FWD_REF(Q6) q6
|
||||
#define BOOST_MOVE_UREFQ8 BOOST_MOVE_UREFQ7, BOOST_FWD_REF(Q7) q7
|
||||
#define BOOST_MOVE_UREFQ9 BOOST_MOVE_UREFQ8, BOOST_FWD_REF(Q8) q8
|
||||
|
||||
//BOOST_MOVE_CREFN
|
||||
#define BOOST_MOVE_UNVOIDCREF(T) const typename boost::move_detail::unvoid<T>::type&
|
||||
#define BOOST_MOVE_CREF0
|
||||
#define BOOST_MOVE_CREF1 BOOST_MOVE_UNVOIDCREF(P0) p0
|
||||
#define BOOST_MOVE_CREF2 BOOST_MOVE_CREF1, BOOST_MOVE_UNVOIDCREF(P1) p1
|
||||
#define BOOST_MOVE_CREF3 BOOST_MOVE_CREF2, BOOST_MOVE_UNVOIDCREF(P2) p2
|
||||
#define BOOST_MOVE_CREF4 BOOST_MOVE_CREF3, BOOST_MOVE_UNVOIDCREF(P3) p3
|
||||
#define BOOST_MOVE_CREF5 BOOST_MOVE_CREF4, BOOST_MOVE_UNVOIDCREF(P4) p4
|
||||
#define BOOST_MOVE_CREF6 BOOST_MOVE_CREF5, BOOST_MOVE_UNVOIDCREF(P5) p5
|
||||
#define BOOST_MOVE_CREF7 BOOST_MOVE_CREF6, BOOST_MOVE_UNVOIDCREF(P6) p6
|
||||
#define BOOST_MOVE_CREF8 BOOST_MOVE_CREF7, BOOST_MOVE_UNVOIDCREF(P7) p7
|
||||
#define BOOST_MOVE_CREF9 BOOST_MOVE_CREF8, BOOST_MOVE_UNVOIDCREF(P8) p8
|
||||
|
||||
//BOOST_MOVE_CLASSN
|
||||
#define BOOST_MOVE_CLASS0
|
||||
#define BOOST_MOVE_CLASS1 class P0
|
||||
#define BOOST_MOVE_CLASS2 BOOST_MOVE_CLASS1, class P1
|
||||
#define BOOST_MOVE_CLASS3 BOOST_MOVE_CLASS2, class P2
|
||||
#define BOOST_MOVE_CLASS4 BOOST_MOVE_CLASS3, class P3
|
||||
#define BOOST_MOVE_CLASS5 BOOST_MOVE_CLASS4, class P4
|
||||
#define BOOST_MOVE_CLASS6 BOOST_MOVE_CLASS5, class P5
|
||||
#define BOOST_MOVE_CLASS7 BOOST_MOVE_CLASS6, class P6
|
||||
#define BOOST_MOVE_CLASS8 BOOST_MOVE_CLASS7, class P7
|
||||
#define BOOST_MOVE_CLASS9 BOOST_MOVE_CLASS8, class P8
|
||||
|
||||
//BOOST_MOVE_CLASSQN
|
||||
#define BOOST_MOVE_CLASSQ0
|
||||
#define BOOST_MOVE_CLASSQ1 class Q0
|
||||
#define BOOST_MOVE_CLASSQ2 BOOST_MOVE_CLASSQ1, class Q1
|
||||
#define BOOST_MOVE_CLASSQ3 BOOST_MOVE_CLASSQ2, class Q2
|
||||
#define BOOST_MOVE_CLASSQ4 BOOST_MOVE_CLASSQ3, class Q3
|
||||
#define BOOST_MOVE_CLASSQ5 BOOST_MOVE_CLASSQ4, class Q4
|
||||
#define BOOST_MOVE_CLASSQ6 BOOST_MOVE_CLASSQ5, class Q5
|
||||
#define BOOST_MOVE_CLASSQ7 BOOST_MOVE_CLASSQ6, class Q6
|
||||
#define BOOST_MOVE_CLASSQ8 BOOST_MOVE_CLASSQ7, class Q7
|
||||
#define BOOST_MOVE_CLASSQ9 BOOST_MOVE_CLASSQ8, class Q8
|
||||
|
||||
//BOOST_MOVE_CLASSDFLTN
|
||||
#define BOOST_MOVE_CLASSDFLT0
|
||||
#define BOOST_MOVE_CLASSDFLT1 class P0 = void
|
||||
#define BOOST_MOVE_CLASSDFLT2 BOOST_MOVE_CLASSDFLT1, class P1 = void
|
||||
#define BOOST_MOVE_CLASSDFLT3 BOOST_MOVE_CLASSDFLT2, class P2 = void
|
||||
#define BOOST_MOVE_CLASSDFLT4 BOOST_MOVE_CLASSDFLT3, class P3 = void
|
||||
#define BOOST_MOVE_CLASSDFLT5 BOOST_MOVE_CLASSDFLT4, class P4 = void
|
||||
#define BOOST_MOVE_CLASSDFLT6 BOOST_MOVE_CLASSDFLT5, class P5 = void
|
||||
#define BOOST_MOVE_CLASSDFLT7 BOOST_MOVE_CLASSDFLT6, class P6 = void
|
||||
#define BOOST_MOVE_CLASSDFLT8 BOOST_MOVE_CLASSDFLT7, class P7 = void
|
||||
#define BOOST_MOVE_CLASSDFLT9 BOOST_MOVE_CLASSDFLT8, class P8 = void
|
||||
|
||||
//BOOST_MOVE_TARGN
|
||||
#define BOOST_MOVE_TARG0
|
||||
#define BOOST_MOVE_TARG1 P0
|
||||
#define BOOST_MOVE_TARG2 BOOST_MOVE_TARG1, P1
|
||||
#define BOOST_MOVE_TARG3 BOOST_MOVE_TARG2, P2
|
||||
#define BOOST_MOVE_TARG4 BOOST_MOVE_TARG3, P3
|
||||
#define BOOST_MOVE_TARG5 BOOST_MOVE_TARG4, P4
|
||||
#define BOOST_MOVE_TARG6 BOOST_MOVE_TARG5, P5
|
||||
#define BOOST_MOVE_TARG7 BOOST_MOVE_TARG6, P6
|
||||
#define BOOST_MOVE_TARG8 BOOST_MOVE_TARG7, P7
|
||||
#define BOOST_MOVE_TARG9 BOOST_MOVE_TARG8, P8
|
||||
|
||||
//BOOST_MOVE_FWD_TN
|
||||
#define BOOST_MOVE_FWD_T0
|
||||
#define BOOST_MOVE_FWD_T1 typename ::boost::move_detail::forward_type<P0>::type
|
||||
#define BOOST_MOVE_FWD_T2 BOOST_MOVE_FWD_T1, typename ::boost::move_detail::forward_type<P1>::type
|
||||
#define BOOST_MOVE_FWD_T3 BOOST_MOVE_FWD_T2, typename ::boost::move_detail::forward_type<P2>::type
|
||||
#define BOOST_MOVE_FWD_T4 BOOST_MOVE_FWD_T3, typename ::boost::move_detail::forward_type<P3>::type
|
||||
#define BOOST_MOVE_FWD_T5 BOOST_MOVE_FWD_T4, typename ::boost::move_detail::forward_type<P4>::type
|
||||
#define BOOST_MOVE_FWD_T6 BOOST_MOVE_FWD_T5, typename ::boost::move_detail::forward_type<P5>::type
|
||||
#define BOOST_MOVE_FWD_T7 BOOST_MOVE_FWD_T6, typename ::boost::move_detail::forward_type<P6>::type
|
||||
#define BOOST_MOVE_FWD_T8 BOOST_MOVE_FWD_T7, typename ::boost::move_detail::forward_type<P7>::type
|
||||
#define BOOST_MOVE_FWD_T9 BOOST_MOVE_FWD_T8, typename ::boost::move_detail::forward_type<P8>::type
|
||||
|
||||
//BOOST_MOVE_MREFX
|
||||
#define BOOST_MOVE_MREF0
|
||||
#define BOOST_MOVE_MREF1 BOOST_MOVE_MREF(P0) m_p0;
|
||||
#define BOOST_MOVE_MREF2 BOOST_MOVE_MREF1 BOOST_MOVE_MREF(P1) m_p1;
|
||||
#define BOOST_MOVE_MREF3 BOOST_MOVE_MREF2 BOOST_MOVE_MREF(P2) m_p2;
|
||||
#define BOOST_MOVE_MREF4 BOOST_MOVE_MREF3 BOOST_MOVE_MREF(P3) m_p3;
|
||||
#define BOOST_MOVE_MREF5 BOOST_MOVE_MREF4 BOOST_MOVE_MREF(P4) m_p4;
|
||||
#define BOOST_MOVE_MREF6 BOOST_MOVE_MREF5 BOOST_MOVE_MREF(P5) m_p5;
|
||||
#define BOOST_MOVE_MREF7 BOOST_MOVE_MREF6 BOOST_MOVE_MREF(P6) m_p6;
|
||||
#define BOOST_MOVE_MREF8 BOOST_MOVE_MREF7 BOOST_MOVE_MREF(P7) m_p7;
|
||||
#define BOOST_MOVE_MREF9 BOOST_MOVE_MREF8 BOOST_MOVE_MREF(P8) m_p8;
|
||||
|
||||
//BOOST_MOVE_MEMBX
|
||||
#define BOOST_MOVE_MEMB0
|
||||
#define BOOST_MOVE_MEMB1 P0 m_p0;
|
||||
#define BOOST_MOVE_MEMB2 BOOST_MOVE_MEMB1 P1 m_p1;
|
||||
#define BOOST_MOVE_MEMB3 BOOST_MOVE_MEMB2 P2 m_p2;
|
||||
#define BOOST_MOVE_MEMB4 BOOST_MOVE_MEMB3 P3 m_p3;
|
||||
#define BOOST_MOVE_MEMB5 BOOST_MOVE_MEMB4 P4 m_p4;
|
||||
#define BOOST_MOVE_MEMB6 BOOST_MOVE_MEMB5 P5 m_p5;
|
||||
#define BOOST_MOVE_MEMB7 BOOST_MOVE_MEMB6 P6 m_p6;
|
||||
#define BOOST_MOVE_MEMB8 BOOST_MOVE_MEMB7 P7 m_p7;
|
||||
#define BOOST_MOVE_MEMB9 BOOST_MOVE_MEMB8 P8 m_p8;
|
||||
|
||||
//BOOST_MOVE_TMPL_LTN
|
||||
#define BOOST_MOVE_TMPL_LT0
|
||||
#define BOOST_MOVE_TMPL_LT1 template<
|
||||
#define BOOST_MOVE_TMPL_LT2 BOOST_MOVE_TMPL_LT1
|
||||
#define BOOST_MOVE_TMPL_LT3 BOOST_MOVE_TMPL_LT1
|
||||
#define BOOST_MOVE_TMPL_LT4 BOOST_MOVE_TMPL_LT1
|
||||
#define BOOST_MOVE_TMPL_LT5 BOOST_MOVE_TMPL_LT1
|
||||
#define BOOST_MOVE_TMPL_LT6 BOOST_MOVE_TMPL_LT1
|
||||
#define BOOST_MOVE_TMPL_LT7 BOOST_MOVE_TMPL_LT1
|
||||
#define BOOST_MOVE_TMPL_LT8 BOOST_MOVE_TMPL_LT1
|
||||
#define BOOST_MOVE_TMPL_LT9 BOOST_MOVE_TMPL_LT1
|
||||
|
||||
//BOOST_MOVE_LTN
|
||||
#define BOOST_MOVE_LT0
|
||||
#define BOOST_MOVE_LT1 <
|
||||
#define BOOST_MOVE_LT2 BOOST_MOVE_LT1
|
||||
#define BOOST_MOVE_LT3 BOOST_MOVE_LT1
|
||||
#define BOOST_MOVE_LT4 BOOST_MOVE_LT1
|
||||
#define BOOST_MOVE_LT5 BOOST_MOVE_LT1
|
||||
#define BOOST_MOVE_LT6 BOOST_MOVE_LT1
|
||||
#define BOOST_MOVE_LT7 BOOST_MOVE_LT1
|
||||
#define BOOST_MOVE_LT8 BOOST_MOVE_LT1
|
||||
#define BOOST_MOVE_LT9 BOOST_MOVE_LT1
|
||||
|
||||
//BOOST_MOVE_GTN
|
||||
#define BOOST_MOVE_GT0
|
||||
#define BOOST_MOVE_GT1 >
|
||||
#define BOOST_MOVE_GT2 BOOST_MOVE_GT1
|
||||
#define BOOST_MOVE_GT3 BOOST_MOVE_GT1
|
||||
#define BOOST_MOVE_GT4 BOOST_MOVE_GT1
|
||||
#define BOOST_MOVE_GT5 BOOST_MOVE_GT1
|
||||
#define BOOST_MOVE_GT6 BOOST_MOVE_GT1
|
||||
#define BOOST_MOVE_GT7 BOOST_MOVE_GT1
|
||||
#define BOOST_MOVE_GT8 BOOST_MOVE_GT1
|
||||
#define BOOST_MOVE_GT9 BOOST_MOVE_GT1
|
||||
|
||||
//BOOST_MOVE_LPN
|
||||
#define BOOST_MOVE_LP0
|
||||
#define BOOST_MOVE_LP1 (
|
||||
#define BOOST_MOVE_LP2 BOOST_MOVE_LP1
|
||||
#define BOOST_MOVE_LP3 BOOST_MOVE_LP1
|
||||
#define BOOST_MOVE_LP4 BOOST_MOVE_LP1
|
||||
#define BOOST_MOVE_LP5 BOOST_MOVE_LP1
|
||||
#define BOOST_MOVE_LP6 BOOST_MOVE_LP1
|
||||
#define BOOST_MOVE_LP7 BOOST_MOVE_LP1
|
||||
#define BOOST_MOVE_LP8 BOOST_MOVE_LP1
|
||||
#define BOOST_MOVE_LP9 BOOST_MOVE_LP1
|
||||
|
||||
//BOOST_MOVE_RPN
|
||||
#define BOOST_MOVE_RP0
|
||||
#define BOOST_MOVE_RP1 )
|
||||
#define BOOST_MOVE_RP2 BOOST_MOVE_RP1
|
||||
#define BOOST_MOVE_RP3 BOOST_MOVE_RP1
|
||||
#define BOOST_MOVE_RP4 BOOST_MOVE_RP1
|
||||
#define BOOST_MOVE_RP5 BOOST_MOVE_RP1
|
||||
#define BOOST_MOVE_RP6 BOOST_MOVE_RP1
|
||||
#define BOOST_MOVE_RP7 BOOST_MOVE_RP1
|
||||
#define BOOST_MOVE_RP8 BOOST_MOVE_RP1
|
||||
#define BOOST_MOVE_RP9 BOOST_MOVE_RP1
|
||||
|
||||
//BOOST_MOVE_IN
|
||||
#define BOOST_MOVE_I0
|
||||
#define BOOST_MOVE_I1 ,
|
||||
#define BOOST_MOVE_I2 BOOST_MOVE_I1
|
||||
#define BOOST_MOVE_I3 BOOST_MOVE_I1
|
||||
#define BOOST_MOVE_I4 BOOST_MOVE_I1
|
||||
#define BOOST_MOVE_I5 BOOST_MOVE_I1
|
||||
#define BOOST_MOVE_I6 BOOST_MOVE_I1
|
||||
#define BOOST_MOVE_I7 BOOST_MOVE_I1
|
||||
#define BOOST_MOVE_I8 BOOST_MOVE_I1
|
||||
#define BOOST_MOVE_I9 BOOST_MOVE_I1
|
||||
|
||||
//BOOST_MOVE_COLON
|
||||
#define BOOST_MOVE_COLON0
|
||||
#define BOOST_MOVE_COLON1 :
|
||||
#define BOOST_MOVE_COLON2 BOOST_MOVE_COLON1
|
||||
#define BOOST_MOVE_COLON3 BOOST_MOVE_COLON1
|
||||
#define BOOST_MOVE_COLON4 BOOST_MOVE_COLON1
|
||||
#define BOOST_MOVE_COLON5 BOOST_MOVE_COLON1
|
||||
#define BOOST_MOVE_COLON6 BOOST_MOVE_COLON1
|
||||
#define BOOST_MOVE_COLON7 BOOST_MOVE_COLON1
|
||||
#define BOOST_MOVE_COLON8 BOOST_MOVE_COLON1
|
||||
#define BOOST_MOVE_COLON9 BOOST_MOVE_COLON1
|
||||
|
||||
//BOOST_MOVE_ITERATE_2TON
|
||||
#define BOOST_MOVE_ITERATE_2TO2(MACROFUNC) MACROFUNC(2)
|
||||
#define BOOST_MOVE_ITERATE_2TO3(MACROFUNC) BOOST_MOVE_ITERATE_2TO2(MACROFUNC) MACROFUNC(3)
|
||||
#define BOOST_MOVE_ITERATE_2TO4(MACROFUNC) BOOST_MOVE_ITERATE_2TO3(MACROFUNC) MACROFUNC(4)
|
||||
#define BOOST_MOVE_ITERATE_2TO5(MACROFUNC) BOOST_MOVE_ITERATE_2TO4(MACROFUNC) MACROFUNC(5)
|
||||
#define BOOST_MOVE_ITERATE_2TO6(MACROFUNC) BOOST_MOVE_ITERATE_2TO5(MACROFUNC) MACROFUNC(6)
|
||||
#define BOOST_MOVE_ITERATE_2TO7(MACROFUNC) BOOST_MOVE_ITERATE_2TO6(MACROFUNC) MACROFUNC(7)
|
||||
#define BOOST_MOVE_ITERATE_2TO8(MACROFUNC) BOOST_MOVE_ITERATE_2TO7(MACROFUNC) MACROFUNC(8)
|
||||
#define BOOST_MOVE_ITERATE_2TO9(MACROFUNC) BOOST_MOVE_ITERATE_2TO8(MACROFUNC) MACROFUNC(9)
|
||||
|
||||
//BOOST_MOVE_ITERATE_1TON
|
||||
#define BOOST_MOVE_ITERATE_1TO1(MACROFUNC) MACROFUNC(1)
|
||||
#define BOOST_MOVE_ITERATE_1TO2(MACROFUNC) BOOST_MOVE_ITERATE_1TO1(MACROFUNC) MACROFUNC(2)
|
||||
#define BOOST_MOVE_ITERATE_1TO3(MACROFUNC) BOOST_MOVE_ITERATE_1TO2(MACROFUNC) MACROFUNC(3)
|
||||
#define BOOST_MOVE_ITERATE_1TO4(MACROFUNC) BOOST_MOVE_ITERATE_1TO3(MACROFUNC) MACROFUNC(4)
|
||||
#define BOOST_MOVE_ITERATE_1TO5(MACROFUNC) BOOST_MOVE_ITERATE_1TO4(MACROFUNC) MACROFUNC(5)
|
||||
#define BOOST_MOVE_ITERATE_1TO6(MACROFUNC) BOOST_MOVE_ITERATE_1TO5(MACROFUNC) MACROFUNC(6)
|
||||
#define BOOST_MOVE_ITERATE_1TO7(MACROFUNC) BOOST_MOVE_ITERATE_1TO6(MACROFUNC) MACROFUNC(7)
|
||||
#define BOOST_MOVE_ITERATE_1TO8(MACROFUNC) BOOST_MOVE_ITERATE_1TO7(MACROFUNC) MACROFUNC(8)
|
||||
#define BOOST_MOVE_ITERATE_1TO9(MACROFUNC) BOOST_MOVE_ITERATE_1TO8(MACROFUNC) MACROFUNC(9)
|
||||
|
||||
//BOOST_MOVE_ITERATE_0TON
|
||||
#define BOOST_MOVE_ITERATE_0TO0(MACROFUNC) MACROFUNC(0)
|
||||
#define BOOST_MOVE_ITERATE_0TO1(MACROFUNC) BOOST_MOVE_ITERATE_0TO0(MACROFUNC) MACROFUNC(1)
|
||||
#define BOOST_MOVE_ITERATE_0TO2(MACROFUNC) BOOST_MOVE_ITERATE_0TO1(MACROFUNC) MACROFUNC(2)
|
||||
#define BOOST_MOVE_ITERATE_0TO3(MACROFUNC) BOOST_MOVE_ITERATE_0TO2(MACROFUNC) MACROFUNC(3)
|
||||
#define BOOST_MOVE_ITERATE_0TO4(MACROFUNC) BOOST_MOVE_ITERATE_0TO3(MACROFUNC) MACROFUNC(4)
|
||||
#define BOOST_MOVE_ITERATE_0TO5(MACROFUNC) BOOST_MOVE_ITERATE_0TO4(MACROFUNC) MACROFUNC(5)
|
||||
#define BOOST_MOVE_ITERATE_0TO6(MACROFUNC) BOOST_MOVE_ITERATE_0TO5(MACROFUNC) MACROFUNC(6)
|
||||
#define BOOST_MOVE_ITERATE_0TO7(MACROFUNC) BOOST_MOVE_ITERATE_0TO6(MACROFUNC) MACROFUNC(7)
|
||||
#define BOOST_MOVE_ITERATE_0TO8(MACROFUNC) BOOST_MOVE_ITERATE_0TO7(MACROFUNC) MACROFUNC(8)
|
||||
#define BOOST_MOVE_ITERATE_0TO9(MACROFUNC) BOOST_MOVE_ITERATE_0TO8(MACROFUNC) MACROFUNC(9)
|
||||
|
||||
//BOOST_MOVE_ITERATE_NTON
|
||||
#define BOOST_MOVE_ITERATE_0TO0(MACROFUNC) MACROFUNC(0)
|
||||
#define BOOST_MOVE_ITERATE_1TO1(MACROFUNC) MACROFUNC(1)
|
||||
#define BOOST_MOVE_ITERATE_2TO2(MACROFUNC) MACROFUNC(2)
|
||||
#define BOOST_MOVE_ITERATE_3TO3(MACROFUNC) MACROFUNC(3)
|
||||
#define BOOST_MOVE_ITERATE_4TO4(MACROFUNC) MACROFUNC(4)
|
||||
#define BOOST_MOVE_ITERATE_5TO5(MACROFUNC) MACROFUNC(5)
|
||||
#define BOOST_MOVE_ITERATE_6TO6(MACROFUNC) MACROFUNC(6)
|
||||
#define BOOST_MOVE_ITERATE_7TO7(MACROFUNC) MACROFUNC(7)
|
||||
#define BOOST_MOVE_ITERATE_8TO8(MACROFUNC) MACROFUNC(8)
|
||||
#define BOOST_MOVE_ITERATE_9TO9(MACROFUNC) MACROFUNC(9)
|
||||
|
||||
//BOOST_MOVE_CAT
|
||||
#define BOOST_MOVE_CAT(a, b) BOOST_MOVE_CAT_I(a, b)
|
||||
#define BOOST_MOVE_CAT_I(a, b) a ## b
|
||||
//# define BOOST_MOVE_CAT_I(a, b) BOOST_MOVE_CAT_II(~, a ## b)
|
||||
//# define BOOST_MOVE_CAT_II(p, res) res
|
||||
|
||||
#endif //#ifndef BOOST_MOVE_DETAIL_FWD_MACROS_HPP
|
83
include/boost/move/detail/iterator_traits.hpp
Normal file
83
include/boost/move/detail/iterator_traits.hpp
Normal file
@@ -0,0 +1,83 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2014-2014.
|
||||
// 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/move for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BOOST_MOVE_DETAIL_ITERATOR_TRAITS_HPP
|
||||
#define BOOST_MOVE_DETAIL_ITERATOR_TRAITS_HPP
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#if defined(__clang__) && defined(_LIBCPP_VERSION)
|
||||
#define BOOST_MOVE_CLANG_INLINE_STD_NS
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wc++11-extensions"
|
||||
#define BOOST_MOVE_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
#define BOOST_MOVE_STD_NS_END _LIBCPP_END_NAMESPACE_STD
|
||||
#else
|
||||
#define BOOST_MOVE_STD_NS_BEG namespace std{
|
||||
#define BOOST_MOVE_STD_NS_END }
|
||||
#endif
|
||||
|
||||
BOOST_MOVE_STD_NS_BEG
|
||||
|
||||
struct input_iterator_tag;
|
||||
struct forward_iterator_tag;
|
||||
struct bidirectional_iterator_tag;
|
||||
struct random_access_iterator_tag;
|
||||
struct output_iterator_tag;
|
||||
|
||||
BOOST_MOVE_STD_NS_END
|
||||
|
||||
#ifdef BOOST_MOVE_CLANG_INLINE_STD_NS
|
||||
#pragma GCC diagnostic pop
|
||||
#undef BOOST_MOVE_CLANG_INLINE_STD_NS
|
||||
#endif //BOOST_MOVE_CLANG_INLINE_STD_NS
|
||||
|
||||
namespace boost{ namespace movelib{
|
||||
|
||||
template<class Iterator>
|
||||
struct iterator_traits
|
||||
{
|
||||
typedef typename Iterator::difference_type difference_type;
|
||||
typedef typename Iterator::value_type value_type;
|
||||
typedef typename Iterator::pointer pointer;
|
||||
typedef typename Iterator::reference reference;
|
||||
typedef typename Iterator::iterator_category iterator_category;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct iterator_traits<T*>
|
||||
{
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef T& reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct iterator_traits<const T*>
|
||||
{
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef const T* pointer;
|
||||
typedef const T& reference;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
};
|
||||
|
||||
}} //namespace boost { namespace movelib{
|
||||
|
||||
#endif //#ifndef BOOST_MOVE_DETAIL_ITERATOR_TRAITS_HPP
|
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2012-2012.
|
||||
// (C) Copyright Ion Gaztanaga 2012-2015.
|
||||
// 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)
|
||||
@@ -14,11 +14,11 @@
|
||||
#ifndef BOOST_MOVE_DETAIL_META_UTILS_HPP
|
||||
#define BOOST_MOVE_DETAIL_META_UTILS_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
#include <boost/move/detail/meta_utils_core.hpp>
|
||||
#include <cstddef> //for std::size_t
|
||||
|
||||
//Small meta-typetraits to support move
|
||||
@@ -40,78 +40,6 @@ struct nat{};
|
||||
//////////////////////////////////////
|
||||
template <class T> struct natify{};
|
||||
|
||||
//////////////////////////////////////
|
||||
// if_c
|
||||
//////////////////////////////////////
|
||||
template<bool C, typename T1, typename T2>
|
||||
struct if_c
|
||||
{
|
||||
typedef T1 type;
|
||||
};
|
||||
|
||||
template<typename T1, typename T2>
|
||||
struct if_c<false,T1,T2>
|
||||
{
|
||||
typedef T2 type;
|
||||
};
|
||||
|
||||
//////////////////////////////////////
|
||||
// if_
|
||||
//////////////////////////////////////
|
||||
template<typename T1, typename T2, typename T3>
|
||||
struct if_
|
||||
{
|
||||
typedef typename if_c<0 != T1::value, T2, T3>::type type;
|
||||
};
|
||||
|
||||
//enable_if_
|
||||
template <bool B, class T = nat>
|
||||
struct enable_if_c
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
//////////////////////////////////////
|
||||
// enable_if_c
|
||||
//////////////////////////////////////
|
||||
template <class T>
|
||||
struct enable_if_c<false, T> {};
|
||||
|
||||
//////////////////////////////////////
|
||||
// enable_if
|
||||
//////////////////////////////////////
|
||||
template <class Cond, class T = nat>
|
||||
struct enable_if : public enable_if_c<Cond::value, T> {};
|
||||
|
||||
//////////////////////////////////////
|
||||
// disable_if
|
||||
//////////////////////////////////////
|
||||
template <class Cond, class T = nat>
|
||||
struct disable_if : public enable_if_c<!Cond::value, T> {};
|
||||
|
||||
//////////////////////////////////////
|
||||
// integral_constant
|
||||
//////////////////////////////////////
|
||||
template<class T, T v>
|
||||
struct integral_constant
|
||||
{
|
||||
static const T value = v;
|
||||
typedef T value_type;
|
||||
typedef integral_constant<T, v> type;
|
||||
};
|
||||
|
||||
typedef integral_constant<bool, true > true_type;
|
||||
typedef integral_constant<bool, false > false_type;
|
||||
|
||||
//////////////////////////////////////
|
||||
// identity
|
||||
//////////////////////////////////////
|
||||
template <class T>
|
||||
struct identity
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
//////////////////////////////////////
|
||||
// remove_reference
|
||||
//////////////////////////////////////
|
||||
@@ -231,22 +159,6 @@ struct add_const_lvalue_reference
|
||||
<t_unreferenced_const>::type type;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_same
|
||||
//////////////////////////////////////
|
||||
template<class T, class U>
|
||||
struct is_same
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct is_same<T, T>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_lvalue_reference
|
||||
//////////////////////////////////////
|
||||
@@ -268,7 +180,7 @@ struct is_lvalue_reference<T&>
|
||||
template<class T>
|
||||
struct is_class_or_union
|
||||
{
|
||||
struct twochar { char _[2]; };
|
||||
struct twochar { char dummy[2]; };
|
||||
template <class U>
|
||||
static char is_class_or_union_tester(void(U::*)(void));
|
||||
template <class U>
|
||||
@@ -475,6 +387,4 @@ template< class T > struct remove_rvalue_reference { typedef T type; };
|
||||
} //namespace move_detail {
|
||||
} //namespace boost {
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_MOVE_DETAIL_META_UTILS_HPP
|
||||
|
114
include/boost/move/detail/meta_utils_core.hpp
Normal file
114
include/boost/move/detail/meta_utils_core.hpp
Normal file
@@ -0,0 +1,114 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2015-2015.
|
||||
// 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/move for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP
|
||||
#define BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//Small meta-typetraits to support move
|
||||
|
||||
namespace boost {
|
||||
namespace move_detail {
|
||||
|
||||
//////////////////////////////////////
|
||||
// if_c
|
||||
//////////////////////////////////////
|
||||
template<bool C, typename T1, typename T2>
|
||||
struct if_c
|
||||
{
|
||||
typedef T1 type;
|
||||
};
|
||||
|
||||
template<typename T1, typename T2>
|
||||
struct if_c<false,T1,T2>
|
||||
{
|
||||
typedef T2 type;
|
||||
};
|
||||
|
||||
//////////////////////////////////////
|
||||
// if_
|
||||
//////////////////////////////////////
|
||||
template<typename T1, typename T2, typename T3>
|
||||
struct if_ : if_c<0 != T1::value, T2, T3>
|
||||
{};
|
||||
|
||||
//enable_if_
|
||||
template <bool B, class T = void>
|
||||
struct enable_if_c
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
//////////////////////////////////////
|
||||
// enable_if_c
|
||||
//////////////////////////////////////
|
||||
template <class T>
|
||||
struct enable_if_c<false, T> {};
|
||||
|
||||
//////////////////////////////////////
|
||||
// enable_if
|
||||
//////////////////////////////////////
|
||||
template <class Cond, class T = void>
|
||||
struct enable_if : enable_if_c<Cond::value, T> {};
|
||||
|
||||
//////////////////////////////////////
|
||||
// disable_if
|
||||
//////////////////////////////////////
|
||||
template <class Cond, class T = void>
|
||||
struct disable_if : enable_if_c<!Cond::value, T> {};
|
||||
|
||||
//////////////////////////////////////
|
||||
// integral_constant
|
||||
//////////////////////////////////////
|
||||
template<class T, T v>
|
||||
struct integral_constant
|
||||
{
|
||||
static const T value = v;
|
||||
typedef T value_type;
|
||||
typedef integral_constant<T, v> type;
|
||||
};
|
||||
|
||||
typedef integral_constant<bool, true > true_type;
|
||||
typedef integral_constant<bool, false > false_type;
|
||||
|
||||
//////////////////////////////////////
|
||||
// identity
|
||||
//////////////////////////////////////
|
||||
template <class T>
|
||||
struct identity
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_same
|
||||
//////////////////////////////////////
|
||||
template<class T, class U>
|
||||
struct is_same
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct is_same<T, T>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
} //namespace move_detail {
|
||||
} //namespace boost {
|
||||
|
||||
#endif //#ifndef BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP
|
@@ -12,7 +12,7 @@
|
||||
#ifndef BOOST_MOVE_MOVE_HELPERS_HPP
|
||||
#define BOOST_MOVE_MOVE_HELPERS_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
875
include/boost/move/detail/type_traits.hpp
Normal file
875
include/boost/move/detail/type_traits.hpp
Normal file
@@ -0,0 +1,875 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// (C) Copyright John Maddock 2000.
|
||||
// (C) Copyright Ion Gaztanaga 2005-2015.
|
||||
//
|
||||
// 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/move for documentation.
|
||||
//
|
||||
// The alignment and Type traits implementation comes from
|
||||
// John Maddock's TypeTraits library.
|
||||
//
|
||||
// Some other tricks come from Howard Hinnant's papers and StackOverflow replies
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef BOOST_MOVE_DETAIL_TYPE_TRAITS_HPP
|
||||
#define BOOST_MOVE_DETAIL_TYPE_TRAITS_HPP
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
#include <boost/move/detail/workaround.hpp>
|
||||
|
||||
// move/detail
|
||||
#include <boost/move/detail/meta_utils.hpp>
|
||||
// other
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
// std
|
||||
#include <cstddef>
|
||||
|
||||
//Use of Boost.TypeTraits leads to long preprocessed source code due to
|
||||
//MPL dependencies. We'll use intrinsics directly and make or own
|
||||
//simplified version of TypeTraits.
|
||||
//If someday Boost.TypeTraits dependencies are minimized, we should
|
||||
//revisit this file redirecting code to Boost.TypeTraits traits.
|
||||
|
||||
//These traits don't care about volatile, reference or other checks
|
||||
//made by Boost.TypeTraits because no volatile or reference types
|
||||
//can be hold in Boost.Containers. This helps to avoid any Boost.TypeTraits
|
||||
//dependency.
|
||||
|
||||
// Helper macros for builtin compiler support.
|
||||
// If your compiler has builtin support for any of the following
|
||||
// traits concepts, then redefine the appropriate macros to pick
|
||||
// up on the compiler support:
|
||||
//
|
||||
// (these should largely ignore cv-qualifiers)
|
||||
// BOOST_MOVE_IS_POD(T) should evaluate to true if T is a POD type
|
||||
// BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) should evaluate to true if "T x;" has no effect
|
||||
// BOOST_MOVE_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy
|
||||
// BOOST_MOVE_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) should evaluate to true if T(boost::move(t)) <==> memcpy
|
||||
// BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy
|
||||
// BOOST_MOVE_HAS_TRIVIAL_MOVE_ASSIGN(T) should evaluate to true if t = boost::move(u) <==> memcpy
|
||||
// BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect
|
||||
// BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T) should evaluate to true if "T x;" can not throw
|
||||
// BOOST_MOVE_HAS_NOTHROW_COPY(T) should evaluate to true if T(t) can not throw
|
||||
// BOOST_MOVE_HAS_NOTHROW_ASSIGN(T) should evaluate to true if t = u can not throw
|
||||
// BOOST_MOVE_IS_ENUM(T) should evaluate to true it t is a union type.
|
||||
//
|
||||
// The following can also be defined: when detected our implementation is greatly simplified.
|
||||
//
|
||||
// BOOST_ALIGNMENT_OF(T) should evaluate to the alignment requirements of type T.
|
||||
|
||||
#if defined(__MSL_CPP__) && (__MSL_CPP__ >= 0x8000)
|
||||
// Metrowerks compiler is acquiring intrinsic type traits support
|
||||
// post version 8. We hook into the published interface to pick up
|
||||
// user defined specializations as well as compiler intrinsics as
|
||||
// and when they become available:
|
||||
# include <msl_utility>
|
||||
# define BOOST_MOVE_IS_POD(T) BOOST_STD_EXTENSION_NAMESPACE::is_POD<T>::value
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_default_ctor<T>::value
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_COPY(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_copy_ctor<T>::value
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_assignment<T>::value
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_dtor<T>::value
|
||||
#endif
|
||||
|
||||
#if (defined(BOOST_MSVC) && defined(BOOST_MSVC_FULL_VER) && (BOOST_MSVC_FULL_VER >=140050215))\
|
||||
|| (defined(BOOST_INTEL) && defined(_MSC_VER) && (_MSC_VER >= 1500))
|
||||
# define BOOST_MOVE_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(T))
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T)|| ::boost::move_detail::is_pod<T>::value)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ::boost::move_detail::is_pod<T>::value)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::move_detail::is_pod<T>::value)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::move_detail::is_trivially_default_constructible<T>::value)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) || ::boost::move_detail::is_trivially_copy_constructible<T>::value)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::move_detail::is_trivially_copy_assignable<T>::value)
|
||||
|
||||
# define BOOST_MOVE_IS_ENUM(T) __is_enum(T)
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1700)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__has_trivial_move_constructor(T) || ::boost::move_detail::is_pod<T>::value)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_MOVE_ASSIGN(T) (__has_trivial_move_assign(T) || ::boost::move_detail::is_pod<T>::value)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_CLANG) && defined(__has_feature)
|
||||
|
||||
# if (!defined(__GLIBCXX__) || (__GLIBCXX__ >= 20080306 && __GLIBCXX__ != 20080519)) && __has_feature(is_pod)
|
||||
# define BOOST_MOVE_IS_POD(T) __is_pod(T)
|
||||
# endif
|
||||
# if __has_feature(has_trivial_constructor)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
|
||||
# endif
|
||||
# if __has_feature(has_trivial_copy)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T))
|
||||
# endif
|
||||
# if __has_feature(has_trivial_assign)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) )
|
||||
# endif
|
||||
# if __has_feature(has_trivial_destructor)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
|
||||
# endif
|
||||
# if __has_feature(has_nothrow_constructor)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
|
||||
# endif
|
||||
# if __has_feature(has_nothrow_copy)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T))
|
||||
# endif
|
||||
# if __has_feature(is_nothrow_copy_assignable)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T))
|
||||
# endif
|
||||
# if __has_feature(is_enum)
|
||||
# define BOOST_MOVE_IS_ENUM(T) __is_enum(T)
|
||||
# endif
|
||||
# if __has_feature(has_trivial_move_constructor)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) __has_trivial_move_constructor(T)
|
||||
# endif
|
||||
# if __has_feature(has_trivial_move_assign)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_MOVE_ASSIGN(T) __has_trivial_move_assign(T)
|
||||
# endif
|
||||
# define BOOST_MOVE_ALIGNMENT_OF(T) __alignof(T)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) && !defined(BOOST_CLANG)
|
||||
|
||||
#ifdef BOOST_INTEL
|
||||
# define BOOST_MOVE_INTEL_TT_OPTS || ::boost::move_detail::is_pod<T>::value
|
||||
#else
|
||||
# define BOOST_MOVE_INTEL_TT_OPTS
|
||||
#endif
|
||||
|
||||
# define BOOST_MOVE_IS_POD(T) __is_pod(T)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) ((__has_trivial_constructor(T) BOOST_MOVE_INTEL_TT_OPTS))
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_MOVE_INTEL_TT_OPTS))
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_MOVE_INTEL_TT_OPTS) )
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_MOVE_INTEL_TT_OPTS)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) BOOST_MOVE_INTEL_TT_OPTS)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_MOVE_INTEL_TT_OPTS))
|
||||
# define BOOST_MOVE_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_MOVE_INTEL_TT_OPTS))
|
||||
|
||||
# define BOOST_MOVE_IS_ENUM(T) __is_enum(T)
|
||||
# if (!defined(unix) && !defined(__unix__)) || defined(__LP64__)
|
||||
// GCC sometimes lies about alignment requirements
|
||||
// of type double on 32-bit unix platforms, use the
|
||||
// old implementation instead in that case:
|
||||
# define BOOST_MOVE_ALIGNMENT_OF(T) __alignof__(T)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600)
|
||||
|
||||
# define BOOST_MOVE_IS_POD(T) __is_pod(T)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T))
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T))
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
|
||||
# define BOOST_MOVE_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T))
|
||||
# define BOOST_MOVE_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T))
|
||||
|
||||
# define BOOST_MOVE_IS_ENUM(T) __is_enum(T)
|
||||
# define BOOST_MOVE_ALIGNMENT_OF(T) __alignof__(T)
|
||||
#endif
|
||||
|
||||
# if defined(__CODEGEARC__)
|
||||
# define BOOST_MOVE_IS_POD(T) __is_pod(T)
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T))
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T))
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T))
|
||||
# define BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T))
|
||||
# define BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T))
|
||||
# define BOOST_MOVE_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T))
|
||||
# define BOOST_MOVE_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T))
|
||||
|
||||
# define BOOST_MOVE_IS_ENUM(T) __is_enum(T)
|
||||
# define BOOST_MOVE_ALIGNMENT_OF(T) alignof(T)
|
||||
|
||||
#endif
|
||||
|
||||
//Fallback definitions
|
||||
#ifdef BOOST_MOVE_IS_POD
|
||||
#define BOOST_MOVE_IS_POD_IMPL(T) BOOST_MOVE_IS_POD(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_POD_IMPL(T) \
|
||||
(::boost::move_detail::is_scalar<T>::value || ::boost::move_detail::is_void<T>::value)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_TRIVIAL_COPY
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_COPY(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_CONSTRUCTOR(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_TRIVIAL_COPY
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_COPY(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_TRIVIAL_MOVE_CONSTRUCTOR
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_TRIVIAL_ASSIGN
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T) BOOST_MOVE_HAS_TRIVIAL_ASSIGN(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_TRIVIAL_MOVE_ASSIGN
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_MOVE_ASSIGNABLE(T) BOOST_MOVE_HAS_TRIVIAL_MOVE_ASSIGN(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_MOVE_ASSIGNABLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_DESTRUCTIBLE(T) BOOST_MOVE_HAS_TRIVIAL_DESTRUCTOR(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_TRIVIALLY_DESTRUCTIBLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR
|
||||
#define BOOST_MOVE_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_NOTHROW_CONSTRUCTOR(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_NOTHROW_COPY
|
||||
#define BOOST_MOVE_IS_NOTHROW_COPY_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_NOTHROW_COPY(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_NOTHROW_COPY_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_NOTHROW_MOVE
|
||||
#define BOOST_MOVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE(T) BOOST_MOVE_HAS_NOTHROW_MOVE(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_NOTHROW_ASSIGN
|
||||
#define BOOST_MOVE_IS_NOTHROW_COPY_ASSIGNABLE(T) BOOST_MOVE_HAS_NOTHROW_ASSIGN(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_NOTHROW_COPY_ASSIGNABLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_HAS_NOTHROW_MOVE_ASSIGN
|
||||
#define BOOST_MOVE_IS_NOTHROW_MOVE_ASSIGNABLE(T) BOOST_MOVE_HAS_NOTHROW_MOVE_ASSIGN(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_NOTHROW_MOVE_ASSIGNABLE(T) ::boost::move_detail::is_pod<T>::value
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MOVE_IS_ENUM
|
||||
#define BOOST_MOVE_IS_ENUM_IMPL(T) BOOST_MOVE_IS_ENUM(T)
|
||||
#else
|
||||
#define BOOST_MOVE_IS_ENUM_IMPL(T) ::boost::move_detail::is_enum_nonintrinsic<T>::value
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace move_detail {
|
||||
|
||||
//////////////////////////
|
||||
// is_reference
|
||||
//////////////////////////
|
||||
template<class T>
|
||||
struct is_reference
|
||||
{ static const bool value = false; };
|
||||
|
||||
template<class T>
|
||||
struct is_reference<T&>
|
||||
{ static const bool value = true; };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template<class T>
|
||||
struct is_reference<T&&>
|
||||
{ static const bool value = true; };
|
||||
#endif
|
||||
|
||||
//////////////////////////
|
||||
// is_pointer
|
||||
//////////////////////////
|
||||
template<class T>
|
||||
struct is_pointer
|
||||
{ static const bool value = false; };
|
||||
|
||||
template<class T>
|
||||
struct is_pointer<T*>
|
||||
{ static const bool value = true; };
|
||||
|
||||
//////////////////////////
|
||||
// add_reference
|
||||
//////////////////////////
|
||||
template <typename T>
|
||||
struct add_reference
|
||||
{ typedef T& type; };
|
||||
|
||||
template<class T>
|
||||
struct add_reference<T&>
|
||||
{ typedef T& type; };
|
||||
|
||||
template<>
|
||||
struct add_reference<void>
|
||||
{ typedef nat &type; };
|
||||
|
||||
template<>
|
||||
struct add_reference<const void>
|
||||
{ typedef const nat &type; };
|
||||
|
||||
//////////////////////////
|
||||
// add_const_reference
|
||||
//////////////////////////
|
||||
template <class T>
|
||||
struct add_const_reference
|
||||
{ typedef const T &type; };
|
||||
|
||||
template <class T>
|
||||
struct add_const_reference<T&>
|
||||
{ typedef T& type; };
|
||||
|
||||
//////////////////////////
|
||||
// remove_const
|
||||
//////////////////////////
|
||||
template<class T>
|
||||
struct remove_const
|
||||
{ typedef T type; };
|
||||
|
||||
template<class T>
|
||||
struct remove_const< const T>
|
||||
{ typedef T type; };
|
||||
|
||||
//////////////////////////
|
||||
// remove_cv
|
||||
//////////////////////////
|
||||
template<typename T> struct remove_cv { typedef T type; };
|
||||
template<typename T> struct remove_cv<const T> { typedef T type; };
|
||||
template<typename T> struct remove_cv<const volatile T> { typedef T type; };
|
||||
template<typename T> struct remove_cv<volatile T> { typedef T type; };
|
||||
|
||||
//////////////////////////
|
||||
// make_unsigned
|
||||
//////////////////////////
|
||||
template <class T>
|
||||
struct make_unsigned_impl { typedef T type; };
|
||||
template <> struct make_unsigned_impl<signed char> { typedef unsigned char type; };
|
||||
template <> struct make_unsigned_impl<signed short> { typedef unsigned short type; };
|
||||
template <> struct make_unsigned_impl<signed int> { typedef unsigned int type; };
|
||||
template <> struct make_unsigned_impl<signed long> { typedef unsigned long type; };
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template <> struct make_unsigned_impl< ::boost::long_long_type > { typedef ::boost::ulong_long_type type; };
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
struct make_unsigned
|
||||
: make_unsigned_impl<typename remove_cv<T>::type>
|
||||
{};
|
||||
|
||||
//////////////////////////
|
||||
// is_floating_point
|
||||
//////////////////////////
|
||||
template<class T> struct is_floating_point_cv { static const bool value = false; };
|
||||
template<> struct is_floating_point_cv<float> { static const bool value = true; };
|
||||
template<> struct is_floating_point_cv<double> { static const bool value = true; };
|
||||
template<> struct is_floating_point_cv<long double> { static const bool value = true; };
|
||||
|
||||
template<class T>
|
||||
struct is_floating_point
|
||||
: is_floating_point_cv<typename remove_cv<T>::type>
|
||||
{};
|
||||
|
||||
//////////////////////////
|
||||
// is_integral
|
||||
//////////////////////////
|
||||
template<class T> struct is_integral_cv { static const bool value = false; };
|
||||
template<> struct is_integral_cv< bool>{ static const bool value = true; };
|
||||
template<> struct is_integral_cv< char>{ static const bool value = true; };
|
||||
template<> struct is_integral_cv< unsigned char>{ static const bool value = true; };
|
||||
template<> struct is_integral_cv< signed char>{ static const bool value = true; };
|
||||
#ifndef BOOST_NO_CXX11_CHAR16_T
|
||||
template<> struct is_integral_cv< char16_t>{ static const bool value = true; };
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_CHAR32_T
|
||||
template<> struct is_integral_cv< char32_t>{ static const bool value = true; };
|
||||
#endif
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<> struct is_integral_cv< wchar_t>{ static const bool value = true; };
|
||||
#endif
|
||||
template<> struct is_integral_cv< short>{ static const bool value = true; };
|
||||
template<> struct is_integral_cv< unsigned short>{ static const bool value = true; };
|
||||
template<> struct is_integral_cv< int>{ static const bool value = true; };
|
||||
template<> struct is_integral_cv< unsigned int>{ static const bool value = true; };
|
||||
template<> struct is_integral_cv< long>{ static const bool value = true; };
|
||||
template<> struct is_integral_cv< unsigned long>{ static const bool value = true; };
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
template<> struct is_integral_cv< ::boost:: long_long_type>{ static const bool value = true; };
|
||||
template<> struct is_integral_cv< ::boost::ulong_long_type>{ static const bool value = true; };
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
struct is_integral
|
||||
: public is_integral_cv<typename remove_cv<T>::type>
|
||||
{};
|
||||
|
||||
//////////////////////////
|
||||
// is_scalar
|
||||
//////////////////////////
|
||||
template<class T>
|
||||
struct is_scalar
|
||||
{ static const bool value = is_integral<T>::value || is_floating_point<T>::value; };
|
||||
|
||||
//////////////////////////
|
||||
// is_void
|
||||
//////////////////////////
|
||||
template<class T>
|
||||
struct is_void_cv
|
||||
{ static const bool value = false; };
|
||||
|
||||
template<>
|
||||
struct is_void_cv<void>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template<class T>
|
||||
struct is_void
|
||||
: is_void_cv<typename remove_cv<T>::type>
|
||||
{};
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_array
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_array
|
||||
{ static const bool value = false; };
|
||||
|
||||
template<class T>
|
||||
struct is_array<T[]>
|
||||
{ static const bool value = true; };
|
||||
|
||||
template<class T, std::size_t N>
|
||||
struct is_array<T[N]>
|
||||
{ static const bool value = true; };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_member_pointer
|
||||
//////////////////////////////////////
|
||||
template <class T> struct is_member_pointer_cv { static const bool value = false; };
|
||||
template <class T, class U>struct is_member_pointer_cv<T U::*> { static const bool value = true; };
|
||||
|
||||
template <class T>
|
||||
struct is_member_pointer
|
||||
: is_member_pointer_cv<typename remove_cv<T>::type>
|
||||
{};
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_nullptr_t
|
||||
//////////////////////////////////////
|
||||
template <class T>
|
||||
struct is_nullptr_t_cv
|
||||
{ static const bool value = false; };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_NULLPTR)
|
||||
template <>
|
||||
struct is_nullptr_t_cv
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE)
|
||||
<decltype(nullptr)>
|
||||
#else
|
||||
<std::nullptr_t>
|
||||
#endif
|
||||
{ static const bool value = true; };
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
struct is_nullptr_t
|
||||
: is_nullptr_t_cv<typename remove_cv<T>::type>
|
||||
{};
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_function
|
||||
//////////////////////////////////////
|
||||
//Inspired by libc++, thanks to Howard Hinnant
|
||||
//For a function to pointer an lvalue of function type T can be implicitly converted to a prvalue
|
||||
//pointer to that function. This does not apply to non-static member functions because lvalues
|
||||
//that refer to non-static member functions do not exist.
|
||||
template <class T>
|
||||
struct is_reference_convertible_to_pointer
|
||||
{
|
||||
struct twochar { char dummy[2]; };
|
||||
template <class U> static char test(U*);
|
||||
template <class U> static twochar test(...);
|
||||
static T& source();
|
||||
static const bool value = sizeof(char) == sizeof(test<T>(source()));
|
||||
};
|
||||
//Filter out:
|
||||
// - class types that might have implicit conversions
|
||||
// - void (to avoid forming a reference to void later)
|
||||
// - references (e.g.: filtering reference to functions)
|
||||
// - nullptr_t (convertible to pointer)
|
||||
template < class T
|
||||
, bool Filter = is_class_or_union<T>::value ||
|
||||
is_void<T>::value ||
|
||||
is_reference<T>::value ||
|
||||
is_nullptr_t<T>::value >
|
||||
struct is_function_impl
|
||||
{ static const bool value = is_reference_convertible_to_pointer<T>::value; };
|
||||
|
||||
template <class T>
|
||||
struct is_function_impl<T, true>
|
||||
{ static const bool value = false; };
|
||||
|
||||
template <class T>
|
||||
struct is_function
|
||||
: is_function_impl<T>
|
||||
{};
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_enum
|
||||
//////////////////////////////////////
|
||||
#if !defined(BOOST_MOVE_IS_ENUM)
|
||||
//Based on (http://howardhinnant.github.io/TypeHiearchy.pdf)
|
||||
template <class T>
|
||||
struct is_enum_nonintrinsic
|
||||
{
|
||||
static const bool value = !is_void<T>::value &&
|
||||
!is_floating_point<T>::value &&
|
||||
!is_integral<T>::value &&
|
||||
!is_nullptr_t<T>::value &&
|
||||
!is_member_pointer<T>::value &&
|
||||
!is_pointer<T>::value &&
|
||||
!is_array<T>::value &&
|
||||
!is_class_or_union<T>::value &&
|
||||
!is_reference<T>::value &&
|
||||
!is_function<T>::value;
|
||||
};
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
struct is_enum
|
||||
{ static const bool value = BOOST_MOVE_IS_ENUM_IMPL(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// remove_all_extents
|
||||
//////////////////////////////////////
|
||||
template <class T>
|
||||
struct remove_all_extents
|
||||
{ typedef T type;};
|
||||
|
||||
template <class T>
|
||||
struct remove_all_extents<T[]>
|
||||
{ typedef typename remove_all_extents<T>::type type; };
|
||||
|
||||
template <class T, size_t N>
|
||||
struct remove_all_extents<T[N]>
|
||||
{ typedef typename remove_all_extents<T>::type type;};
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_pod
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_pod_noextents_cv //for non-c++11 compilers, a safe fallback
|
||||
{ static const bool value = BOOST_MOVE_IS_POD_IMPL(T); };
|
||||
|
||||
template<class T>
|
||||
struct is_pod
|
||||
: is_pod_noextents_cv<typename remove_cv<typename remove_all_extents<T>::type>::type>
|
||||
{};
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_copy_constructible
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_copy_constructible
|
||||
{
|
||||
typedef char yes_type;
|
||||
struct no_type { char dummy[2]; };
|
||||
template<class U> static typename add_reference<U>::type source();
|
||||
|
||||
// Intel compiler has problems with SFINAE for copy constructors and deleted functions:
|
||||
//
|
||||
// error: function *function_name* cannot be referenced -- it is a deleted function
|
||||
// static yes_type test(U&, decltype(U(boost::declval<U&>()))* = 0);
|
||||
// ^
|
||||
// MSVC 12.0 (Visual 2013) has problems when the copy constructor has been deleted. See:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken
|
||||
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_INTEL_CXX_VERSION) &&\
|
||||
!(defined(BOOST_MSVC) && _MSC_VER == 1800)
|
||||
static no_type test(...);
|
||||
#ifdef BOOST_NO_CXX11_DECLTYPE
|
||||
template <class U>
|
||||
static yes_type test(U&, bool_<sizeof(U(source<U>()))>* = 0);
|
||||
#else
|
||||
template <class U>
|
||||
static yes_type test(U&, decltype(U(source<U>()))* = 0);
|
||||
#endif
|
||||
#else
|
||||
template <class U>
|
||||
static no_type test(U&, typename U::boost_move_no_copy_constructor_or_assign* = 0);
|
||||
static yes_type test(...);
|
||||
#endif
|
||||
|
||||
static const bool value = sizeof(test(source<T>())) == sizeof(yes_type);
|
||||
};
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_trivially_destructible
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_trivially_destructible
|
||||
{ static const bool value = BOOST_MOVE_IS_TRIVIALLY_DESTRUCTIBLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_trivially_default_constructible
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_trivially_default_constructible
|
||||
{ static const bool value = BOOST_MOVE_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_trivially_copy_constructible
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_trivially_copy_constructible
|
||||
{ static const bool value = BOOST_MOVE_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_trivially_move_constructible
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_trivially_move_constructible
|
||||
{ static const bool value = BOOST_MOVE_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_trivially_copy_assignable
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_trivially_copy_assignable
|
||||
{ static const bool value = BOOST_MOVE_IS_TRIVIALLY_COPY_ASSIGNABLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_trivially_move_assignable
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_trivially_move_assignable
|
||||
{ static const bool value = BOOST_MOVE_IS_TRIVIALLY_MOVE_ASSIGNABLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_nothrow_default_constructible
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_nothrow_default_constructible
|
||||
: is_pod<T>
|
||||
{ static const bool value = BOOST_MOVE_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_nothrow_copy_constructible
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_nothrow_copy_constructible
|
||||
{ static const bool value = BOOST_MOVE_IS_NOTHROW_COPY_CONSTRUCTIBLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_nothrow_move_constructible
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_nothrow_move_constructible
|
||||
{ static const bool value = BOOST_MOVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_nothrow_copy_assignable
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_nothrow_copy_assignable
|
||||
{ static const bool value = BOOST_MOVE_IS_NOTHROW_COPY_ASSIGNABLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// is_nothrow_move_assignable
|
||||
//////////////////////////////////////
|
||||
template<class T>
|
||||
struct is_nothrow_move_assignable
|
||||
{ static const bool value = BOOST_MOVE_IS_NOTHROW_MOVE_ASSIGNABLE(T); };
|
||||
|
||||
//////////////////////////////////////
|
||||
// alignment_of
|
||||
//////////////////////////////////////
|
||||
template <typename T>
|
||||
struct alignment_of_hack
|
||||
{
|
||||
T t1;
|
||||
char c;
|
||||
T t2;
|
||||
alignment_of_hack();
|
||||
};
|
||||
|
||||
template <unsigned A, unsigned S>
|
||||
struct alignment_logic
|
||||
{ static const std::size_t value = A < S ? A : S; };
|
||||
|
||||
template< typename T >
|
||||
struct alignment_of_impl
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400)
|
||||
// With MSVC both the native __alignof operator
|
||||
// and our own logic gets things wrong from time to time :-(
|
||||
// Using a combination of the two seems to make the most of a bad job:
|
||||
: alignment_logic< sizeof(alignment_of_hack<T>) - 2*sizeof(T), __alignof(T)>
|
||||
{};
|
||||
#elif !defined(BOOST_ALIGNMENT_OF)
|
||||
: alignment_logic< sizeof(alignment_of_hack<T>) - 2*sizeof(T), sizeof(T)>
|
||||
{};
|
||||
#else
|
||||
{ static const std::size_t value = BOOST_MOVE_ALIGNMENT_OF(T); };
|
||||
#endif
|
||||
|
||||
template< typename T >
|
||||
struct alignment_of
|
||||
: alignment_of_impl<T>
|
||||
{};
|
||||
|
||||
class alignment_dummy;
|
||||
typedef void (*function_ptr)();
|
||||
typedef int (alignment_dummy::*member_ptr);
|
||||
typedef int (alignment_dummy::*member_function_ptr)();
|
||||
struct alignment_struct
|
||||
{ long double dummy[4]; };
|
||||
|
||||
/////////////////////////////
|
||||
// max_align_t
|
||||
/////////////////////////////
|
||||
//This is not standard, but should work with all compilers
|
||||
union max_align
|
||||
{
|
||||
char char_;
|
||||
short short_;
|
||||
int int_;
|
||||
long long_;
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
::boost::long_long_type long_long_;
|
||||
#endif
|
||||
float float_;
|
||||
double double_;
|
||||
void * void_ptr_;
|
||||
long double long_double_[4];
|
||||
alignment_dummy *unknown_class_ptr_;
|
||||
function_ptr function_ptr_;
|
||||
member_function_ptr member_function_ptr_;
|
||||
alignment_struct alignment_struct_;
|
||||
};
|
||||
|
||||
typedef union max_align max_align_t;
|
||||
|
||||
/////////////////////////////
|
||||
// aligned_storage
|
||||
/////////////////////////////
|
||||
|
||||
#if !defined(BOOST_NO_ALIGNMENT)
|
||||
|
||||
template<std::size_t Len, std::size_t Align>
|
||||
struct aligned_storage_impl;
|
||||
|
||||
#define BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(A)\
|
||||
template<std::size_t Len>\
|
||||
struct BOOST_ALIGNMENT(A) aligned_storage_impl<Len, A>\
|
||||
{\
|
||||
char dummy[Len];\
|
||||
typedef aligned_storage_impl<Len, A> type;\
|
||||
};\
|
||||
//
|
||||
|
||||
//Up to 4K alignment (typical page size)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x2)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x4)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x8)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x10)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x20)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x40)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x80)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x100)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x200)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x400)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x800)
|
||||
BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT(0x1000)
|
||||
|
||||
#undef BOOST_MOVE_ALIGNED_STORAGE_WITH_BOOST_ALIGNMENT
|
||||
|
||||
#else //BOOST_NO_ALIGNMENT
|
||||
|
||||
template<class T, size_t Len>
|
||||
union aligned_union
|
||||
{
|
||||
T aligner;
|
||||
char dummy[Len];
|
||||
};
|
||||
|
||||
template<std::size_t Len, std::size_t Align, class T, bool Ok>
|
||||
struct aligned_next;
|
||||
|
||||
template<std::size_t Len, std::size_t Align, class T>
|
||||
struct aligned_next<Len, Align, T, true>
|
||||
{
|
||||
BOOST_STATIC_ASSERT((alignment_of<T>::value == Align));
|
||||
typedef aligned_union<T, Len> type;
|
||||
};
|
||||
|
||||
//End of search defaults to max_align_t
|
||||
template<std::size_t Len, std::size_t Align>
|
||||
struct aligned_next<Len, Align, max_align_t, false>
|
||||
{ typedef aligned_union<max_align_t, Len> type; };
|
||||
|
||||
//Now define a search list through types
|
||||
#define BOOST_MOVE_ALIGNED_NEXT_STEP(TYPE, NEXT_TYPE)\
|
||||
template<std::size_t Len, std::size_t Align>\
|
||||
struct aligned_next<Len, Align, TYPE, false>\
|
||||
: aligned_next<Len, Align, NEXT_TYPE, Align == alignment_of<NEXT_TYPE>::value>\
|
||||
{};\
|
||||
//
|
||||
BOOST_MOVE_ALIGNED_NEXT_STEP(long double, max_align_t)
|
||||
BOOST_MOVE_ALIGNED_NEXT_STEP(double, long double)
|
||||
#ifdef BOOST_HAS_LONG_LONG
|
||||
BOOST_MOVE_ALIGNED_NEXT_STEP(::boost::long_long_type, double)
|
||||
BOOST_MOVE_ALIGNED_NEXT_STEP(long, ::boost::long_long_type)
|
||||
#else
|
||||
BOOST_MOVE_ALIGNED_NEXT_STEP(long, double)
|
||||
#endif
|
||||
BOOST_MOVE_ALIGNED_NEXT_STEP(int, long)
|
||||
BOOST_MOVE_ALIGNED_NEXT_STEP(short, int)
|
||||
BOOST_MOVE_ALIGNED_NEXT_STEP(char, short)
|
||||
#undef BOOST_MOVE_ALIGNED_NEXT_STEP
|
||||
|
||||
template<std::size_t Len, std::size_t Align>
|
||||
struct aligned_storage_impl
|
||||
: aligned_next<Len, Align, char, Align == alignment_of<char>::value>
|
||||
{};
|
||||
|
||||
#endif
|
||||
|
||||
template<std::size_t Len, std::size_t Align = alignment_of<max_align_t>::value>
|
||||
struct aligned_storage
|
||||
{
|
||||
//Sanity checks for input parameters
|
||||
BOOST_STATIC_ASSERT(Align > 0);
|
||||
|
||||
//Sanity checks for output type
|
||||
typedef typename aligned_storage_impl<Len ? Len : 1, Align>::type type;
|
||||
static const std::size_t value = alignment_of<type>::value;
|
||||
BOOST_STATIC_ASSERT(value >= Align);
|
||||
BOOST_STATIC_ASSERT((value % Align) == 0);
|
||||
|
||||
//Just in case someone instantiates aligned_storage
|
||||
//instead of aligned_storage::type (typical error).
|
||||
private:
|
||||
aligned_storage();
|
||||
};
|
||||
|
||||
} //namespace move_detail {
|
||||
} //namespace boost {
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_MOVE_DETAIL_TYPE_TRAITS_HPP
|
@@ -14,7 +14,7 @@
|
||||
#ifndef BOOST_MOVE_UNIQUE_PTR_DETAIL_META_UTILS_HPP
|
||||
#define BOOST_MOVE_UNIQUE_PTR_DETAIL_META_UTILS_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP
|
||||
#define BOOST_MOVE_DETAIL_WORKAROUND_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
@@ -27,4 +27,15 @@
|
||||
#define BOOST_MOVE_I ,
|
||||
#define BOOST_MOVE_DOCIGN(T1) T1
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) && !defined(__clang__)
|
||||
//Pre-standard rvalue binding rules
|
||||
#define BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
|
||||
#elif defined(_MSC_VER) && (_MSC_VER == 1600)
|
||||
//Standard rvalue binding rules but with some bugs
|
||||
#define BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
|
||||
#define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
|
||||
#elif defined(_MSC_VER) && (_MSC_VER == 1700)
|
||||
#define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG
|
||||
#endif
|
||||
|
||||
#endif //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP
|
||||
|
@@ -14,13 +14,13 @@
|
||||
#ifndef BOOST_MOVE_ITERATOR_HPP
|
||||
#define BOOST_MOVE_ITERATOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
#include <boost/move/detail/iterator_traits.hpp>
|
||||
#include <boost/move/utility_core.hpp>
|
||||
#include <iterator> //std::iterator
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -40,7 +40,7 @@ class move_iterator
|
||||
{
|
||||
public:
|
||||
typedef It iterator_type;
|
||||
typedef typename std::iterator_traits<iterator_type>::value_type value_type;
|
||||
typedef typename boost::movelib::iterator_traits<iterator_type>::value_type value_type;
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
typedef value_type && reference;
|
||||
#else
|
||||
@@ -50,8 +50,8 @@ class move_iterator
|
||||
, value_type & >::type reference;
|
||||
#endif
|
||||
typedef It pointer;
|
||||
typedef typename std::iterator_traits<iterator_type>::difference_type difference_type;
|
||||
typedef typename std::iterator_traits<iterator_type>::iterator_category iterator_category;
|
||||
typedef typename boost::movelib::iterator_traits<iterator_type>::difference_type difference_type;
|
||||
typedef typename boost::movelib::iterator_traits<iterator_type>::iterator_category iterator_category;
|
||||
|
||||
move_iterator()
|
||||
{}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#ifndef BOOST_MOVE_MAKE_UNIQUE_HPP_INCLUDED
|
||||
#define BOOST_MOVE_MAKE_UNIQUE_HPP_INCLUDED
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
#include <boost/move/unique_ptr.hpp>
|
||||
#include <cstddef> //for std::size_t
|
||||
#include <boost/move/detail/unique_ptr_meta_utils.hpp>
|
||||
#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
# include <boost/move/detail/fwd_macros.hpp>
|
||||
#endif
|
||||
|
||||
//!\file
|
||||
//! Defines "make_unique" functions, which are factories to create instances
|
||||
@@ -61,7 +64,14 @@ struct unique_ptr_if<T[N]>
|
||||
typedef void t_is_array_of_known_bound;
|
||||
};
|
||||
|
||||
static std::nothrow_t *pnothrow;
|
||||
template <int Dummy = 0>
|
||||
struct nothrow_holder
|
||||
{
|
||||
static std::nothrow_t *pnothrow;
|
||||
};
|
||||
|
||||
template <int Dummy>
|
||||
std::nothrow_t *nothrow_holder<Dummy>::pnothrow;
|
||||
|
||||
} //namespace move_upmu {
|
||||
} //namespace boost{
|
||||
@@ -89,422 +99,22 @@ template<class T, class... Args>
|
||||
inline BOOST_MOVE_DOC1ST(unique_ptr<T>,
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array)
|
||||
make_unique_nothrow(BOOST_FWD_REF(Args)... args)
|
||||
{ return unique_ptr<T>(new (*boost::move_upmu::pnothrow)T(::boost::forward<Args>(args)...)); }
|
||||
{ return unique_ptr<T>(new (*boost::move_upmu::nothrow_holder<>::pnothrow)T(::boost::forward<Args>(args)...)); }
|
||||
|
||||
#else
|
||||
|
||||
//0 arg
|
||||
template<class T>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique()
|
||||
{ return unique_ptr<T>(new T()); }
|
||||
|
||||
template<class T>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow()
|
||||
{ return unique_ptr<T>(new (*boost::move_upmu::pnothrow)T()); }
|
||||
|
||||
//1 arg
|
||||
template<class T, class P0>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow( BOOST_FWD_REF(P0) p0
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
)
|
||||
);
|
||||
}
|
||||
//2 arg
|
||||
template<class T, class P0, class P1>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0, class P1>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
)
|
||||
);
|
||||
}
|
||||
//3 arg
|
||||
template<class T, class P0, class P1, class P2>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0, class P1, class P2>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow ( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
)
|
||||
);
|
||||
}
|
||||
//4 arg
|
||||
template<class T, class P0, class P1, class P2, class P3>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0, class P1, class P2, class P3>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow ( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
)
|
||||
);
|
||||
}
|
||||
//5 arg
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow ( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
)
|
||||
);
|
||||
}
|
||||
//6 arg
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow ( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
)
|
||||
);
|
||||
}
|
||||
//7 arg
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5, class P6>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
, BOOST_FWD_REF(P6) p6
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
, ::boost::forward<P6>(p6)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5, class P6>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow ( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
, BOOST_FWD_REF(P6) p6
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
, ::boost::forward<P6>(p6)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//8 arg
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
, BOOST_FWD_REF(P6) p6
|
||||
, BOOST_FWD_REF(P7) p7
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
, ::boost::forward<P6>(p6)
|
||||
, ::boost::forward<P7>(p7)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow ( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
, BOOST_FWD_REF(P6) p6
|
||||
, BOOST_FWD_REF(P7) p7
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
, ::boost::forward<P6>(p6)
|
||||
, ::boost::forward<P7>(p7)
|
||||
)
|
||||
);
|
||||
}
|
||||
//9 arg
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
, BOOST_FWD_REF(P6) p6
|
||||
, BOOST_FWD_REF(P7) p7
|
||||
, BOOST_FWD_REF(P8) p8
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
, ::boost::forward<P6>(p6)
|
||||
, ::boost::forward<P7>(p7)
|
||||
, ::boost::forward<P8>(p8)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow ( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
, BOOST_FWD_REF(P6) p6
|
||||
, BOOST_FWD_REF(P7) p7
|
||||
, BOOST_FWD_REF(P8) p8
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
, ::boost::forward<P6>(p6)
|
||||
, ::boost::forward<P7>(p7)
|
||||
, ::boost::forward<P8>(p8)
|
||||
)
|
||||
);
|
||||
}
|
||||
//10 arg
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
, BOOST_FWD_REF(P6) p6
|
||||
, BOOST_FWD_REF(P7) p7
|
||||
, BOOST_FWD_REF(P8) p8
|
||||
, BOOST_FWD_REF(P9) p9
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new T( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
, ::boost::forward<P6>(p6)
|
||||
, ::boost::forward<P7>(p7)
|
||||
, ::boost::forward<P8>(p8)
|
||||
, ::boost::forward<P9>(p9)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<class T, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array
|
||||
make_unique_nothrow ( BOOST_FWD_REF(P0) p0
|
||||
, BOOST_FWD_REF(P1) p1
|
||||
, BOOST_FWD_REF(P2) p2
|
||||
, BOOST_FWD_REF(P3) p3
|
||||
, BOOST_FWD_REF(P4) p4
|
||||
, BOOST_FWD_REF(P5) p5
|
||||
, BOOST_FWD_REF(P6) p6
|
||||
, BOOST_FWD_REF(P7) p7
|
||||
, BOOST_FWD_REF(P8) p8
|
||||
, BOOST_FWD_REF(P9) p9
|
||||
)
|
||||
{
|
||||
return unique_ptr<T>
|
||||
( new (*boost::move_upmu::pnothrow)T ( ::boost::forward<P0>(p0)
|
||||
, ::boost::forward<P1>(p1)
|
||||
, ::boost::forward<P2>(p2)
|
||||
, ::boost::forward<P3>(p3)
|
||||
, ::boost::forward<P4>(p4)
|
||||
, ::boost::forward<P5>(p5)
|
||||
, ::boost::forward<P6>(p6)
|
||||
, ::boost::forward<P7>(p7)
|
||||
, ::boost::forward<P8>(p8)
|
||||
, ::boost::forward<P9>(p9)
|
||||
)
|
||||
);
|
||||
}
|
||||
#define BOOST_MOVE_MAKE_UNIQUE_CODE(N)\
|
||||
template<class T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N>\
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array\
|
||||
make_unique( BOOST_MOVE_UREF##N)\
|
||||
{ return unique_ptr<T>( new T( BOOST_MOVE_FWD##N ) ); }\
|
||||
\
|
||||
template<class T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N>\
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array\
|
||||
make_unique_nothrow( BOOST_MOVE_UREF##N)\
|
||||
{ return unique_ptr<T>( new (*boost::move_upmu::nothrow_holder<>::pnothrow)T ( BOOST_MOVE_FWD##N ) ); }\
|
||||
//
|
||||
BOOST_MOVE_ITERATE_0TO9(BOOST_MOVE_MAKE_UNIQUE_CODE)
|
||||
#undef BOOST_MOVE_MAKE_UNIQUE_CODE
|
||||
|
||||
#endif
|
||||
|
||||
@@ -527,7 +137,7 @@ inline BOOST_MOVE_DOC1ST(unique_ptr<T>,
|
||||
typename ::boost::move_upmu::unique_ptr_if<T>::t_is_not_array)
|
||||
make_unique_nothrow_definit()
|
||||
{
|
||||
return unique_ptr<T>(new (*boost::move_upmu::pnothrow)T);
|
||||
return unique_ptr<T>(new (*boost::move_upmu::nothrow_holder<>::pnothrow)T);
|
||||
}
|
||||
|
||||
//! <b>Remarks</b>: This function shall not participate in overload resolution unless T is an array of
|
||||
@@ -553,7 +163,7 @@ inline BOOST_MOVE_DOC1ST(unique_ptr<T>,
|
||||
make_unique_nothrow(std::size_t n)
|
||||
{
|
||||
typedef typename ::boost::move_upmu::remove_extent<T>::type U;
|
||||
return unique_ptr<T>(new (*boost::move_upmu::pnothrow)U[n]());
|
||||
return unique_ptr<T>(new (*boost::move_upmu::nothrow_holder<>::pnothrow)U[n]());
|
||||
}
|
||||
|
||||
//! <b>Remarks</b>: This function shall not participate in overload resolution unless T is an array of
|
||||
@@ -579,7 +189,7 @@ inline BOOST_MOVE_DOC1ST(unique_ptr<T>,
|
||||
make_unique_nothrow_definit(std::size_t n)
|
||||
{
|
||||
typedef typename ::boost::move_upmu::remove_extent<T>::type U;
|
||||
return unique_ptr<T>(new (*boost::move_upmu::pnothrow) U[n]);
|
||||
return unique_ptr<T>(new (*boost::move_upmu::nothrow_holder<>::pnothrow) U[n]);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#ifndef BOOST_MOVE_MOVE_HPP
|
||||
#define BOOST_MOVE_MOVE_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
@@ -11,23 +11,20 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BOOST_MOVE_MOVE_TRAITS_HPP
|
||||
#define BOOST_MOVE_MOVE_TRAITS_HPP
|
||||
#ifndef BOOST_MOVE_TRAITS_HPP
|
||||
#define BOOST_MOVE_TRAITS_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#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/type_traits/is_copy_constructible.hpp>
|
||||
#include <boost/move/detail/meta_utils.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#include <boost/move/core.hpp>
|
||||
#endif
|
||||
#include <boost/move/detail/meta_utils.hpp>
|
||||
#include <boost/move/detail/type_traits.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -42,7 +39,7 @@ namespace boost {
|
||||
//! when inserted in containers.
|
||||
template <class T>
|
||||
struct has_trivial_destructor_after_move
|
||||
: ::boost::has_trivial_destructor<T>
|
||||
: ::boost::move_detail::is_trivially_destructible<T>
|
||||
{};
|
||||
|
||||
//! By default this traits returns
|
||||
@@ -52,8 +49,8 @@ struct has_trivial_destructor_after_move
|
||||
template <class T>
|
||||
struct has_nothrow_move
|
||||
{
|
||||
static const bool value = boost::is_nothrow_move_constructible<T>::value &&
|
||||
boost::is_nothrow_move_assignable<T>::value;
|
||||
static const bool value = boost::move_detail::is_nothrow_move_constructible<T>::value &&
|
||||
boost::move_detail::is_nothrow_move_assignable<T>::value;
|
||||
};
|
||||
|
||||
namespace move_detail {
|
||||
@@ -63,9 +60,9 @@ struct is_nothrow_move_constructible_or_uncopyable
|
||||
{
|
||||
//The standard requires is_nothrow_move_constructible for move_if_noexcept
|
||||
//but a user (usually in C++03) might specialize has_nothrow_move which includes it
|
||||
static const bool value = boost::is_nothrow_move_constructible<T>::value ||
|
||||
static const bool value = is_nothrow_move_constructible<T>::value ||
|
||||
has_nothrow_move<T>::value ||
|
||||
!boost::is_copy_constructible<T>::value;
|
||||
!is_copy_constructible<T>::value;
|
||||
};
|
||||
|
||||
} //move_detail {
|
||||
@@ -73,4 +70,4 @@ struct is_nothrow_move_constructible_or_uncopyable
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_MOVE_MOVE_TRAITS_HPP
|
||||
#endif //#ifndef BOOST_MOVE_TRAITS_HPP
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#ifndef BOOST_MOVE_UNIQUE_PTR_HPP_INCLUDED
|
||||
#define BOOST_MOVE_UNIQUE_PTR_HPP_INCLUDED
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#ifndef BOOST_MOVE_MOVE_UTILITY_HPP
|
||||
#define BOOST_MOVE_MOVE_UTILITY_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#ifndef BOOST_MOVE_MOVE_UTILITY_CORE_HPP
|
||||
#define BOOST_MOVE_MOVE_UTILITY_CORE_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
@@ -231,14 +231,18 @@ Global
|
||||
..\..\..\..\boost\move\detail\config_end.hpp = ..\..\..\..\boost\move\detail\config_end.hpp
|
||||
..\..\..\..\boost\move\core.hpp = ..\..\..\..\boost\move\core.hpp
|
||||
..\..\..\..\boost\move\default_delete.hpp = ..\..\..\..\boost\move\default_delete.hpp
|
||||
..\..\..\..\boost\move\detail\fwd_macros.hpp = ..\..\..\..\boost\move\detail\fwd_macros.hpp
|
||||
..\..\..\..\boost\move\iterator.hpp = ..\..\..\..\boost\move\iterator.hpp
|
||||
..\..\..\..\boost\move\detail\iterator_traits.hpp = ..\..\..\..\boost\move\detail\iterator_traits.hpp
|
||||
..\..\doc\Jamfile.v2 = ..\..\doc\Jamfile.v2
|
||||
..\..\..\..\boost\move\make_unique.hpp = ..\..\..\..\boost\move\make_unique.hpp
|
||||
..\..\..\..\boost\move\detail\meta_utils.hpp = ..\..\..\..\boost\move\detail\meta_utils.hpp
|
||||
..\..\..\..\boost\move\detail\meta_utils_core.hpp = ..\..\..\..\boost\move\detail\meta_utils_core.hpp
|
||||
..\..\..\..\boost\move\move.hpp = ..\..\..\..\boost\move\move.hpp
|
||||
..\..\doc\move.qbk = ..\..\doc\move.qbk
|
||||
..\..\..\..\boost\move\detail\move_helpers.hpp = ..\..\..\..\boost\move\detail\move_helpers.hpp
|
||||
..\..\..\..\boost\move\traits.hpp = ..\..\..\..\boost\move\traits.hpp
|
||||
..\..\..\..\boost\move\detail\type_traits.hpp = ..\..\..\..\boost\move\detail\type_traits.hpp
|
||||
..\..\..\..\boost\move\unique_ptr.hpp = ..\..\..\..\boost\move\unique_ptr.hpp
|
||||
..\..\..\..\boost\move\detail\unique_ptr_meta_utils.hpp = ..\..\..\..\boost\move\detail\unique_ptr_meta_utils.hpp
|
||||
..\..\test\unique_ptr_test_utils_beg.hpp = ..\..\test\unique_ptr_test_utils_beg.hpp
|
||||
|
@@ -167,102 +167,3 @@ int main()
|
||||
return ::boost::report_errors();
|
||||
}
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
/*
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
namespace boost_move_member_swap {
|
||||
|
||||
struct dont_care
|
||||
{
|
||||
dont_care(...);
|
||||
};
|
||||
|
||||
struct private_type
|
||||
{
|
||||
static private_type p;
|
||||
private_type const &operator,(int) const;
|
||||
};
|
||||
|
||||
typedef char yes_type;
|
||||
struct no_type{ char dummy[2]; };
|
||||
|
||||
template<typename T>
|
||||
no_type is_private_type(T const &);
|
||||
|
||||
yes_type is_private_type(private_type const &);
|
||||
|
||||
template <typename Type>
|
||||
class has_member_function_named_swap
|
||||
{
|
||||
struct BaseMixin
|
||||
{
|
||||
void swap();
|
||||
};
|
||||
|
||||
struct Base : public Type, public BaseMixin { Base(); };
|
||||
template <typename T, T t> class Helper{};
|
||||
|
||||
template <typename U>
|
||||
static no_type deduce(U*, Helper<void (BaseMixin::*)(), &U::swap>* = 0);
|
||||
static yes_type deduce(...);
|
||||
|
||||
public:
|
||||
static const bool value = sizeof(yes_type) == sizeof(deduce((Base*)(0)));
|
||||
};
|
||||
|
||||
template<typename Fun, bool HasFunc>
|
||||
struct has_member_swap_impl
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template<typename Fun>
|
||||
struct has_member_swap_impl<Fun, true>
|
||||
{
|
||||
struct FunWrap : Fun
|
||||
{
|
||||
FunWrap();
|
||||
|
||||
using Fun::swap;
|
||||
private_type swap(dont_care) const;
|
||||
};
|
||||
|
||||
static Fun &declval_fun();
|
||||
static FunWrap declval_wrap();
|
||||
|
||||
static bool const value =
|
||||
sizeof(no_type) == sizeof(is_private_type( (declval_wrap().swap(declval_fun()), 0)) );
|
||||
};
|
||||
|
||||
template<typename Fun>
|
||||
struct has_member_swap : public has_member_swap_impl
|
||||
<Fun, has_member_function_named_swap<Fun>::value>
|
||||
{};
|
||||
|
||||
} //namespace boost_move_member_swap
|
||||
|
||||
class noswap
|
||||
{
|
||||
public:
|
||||
void swap();
|
||||
};
|
||||
|
||||
class noneswap
|
||||
{
|
||||
};
|
||||
|
||||
class yesswap
|
||||
{
|
||||
public:
|
||||
void swap(yesswap&);
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST(!boost_move_member_swap::has_member_swap<noswap>::value);
|
||||
BOOST_TEST(boost_move_member_swap::has_member_swap<yesswap>::value);
|
||||
BOOST_TEST(!boost_move_member_swap::has_member_swap<noneswap>::value);
|
||||
return boost::report_errors();
|
||||
}
|
||||
*/
|
@@ -9,7 +9,10 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
// move
|
||||
#include <boost/move/algorithm.hpp>
|
||||
#include <boost/move/iterator.hpp>
|
||||
// container
|
||||
#include <boost/container/deque.hpp>
|
||||
#include <boost/container/list.hpp>
|
||||
#include <boost/container/stable_vector.hpp>
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
#include <boost/move/iterator.hpp>
|
||||
#include <boost/container/vector.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include "../example/movable.hpp"
|
||||
|
||||
int main()
|
||||
@@ -20,36 +21,24 @@ int main()
|
||||
bc::vector<movable> v(10);
|
||||
|
||||
//Test default constructed value
|
||||
if(v[0].moved()){
|
||||
return 1;
|
||||
}
|
||||
BOOST_TEST(!v[0].moved());
|
||||
|
||||
//Move values
|
||||
bc::vector<movable> v2
|
||||
(boost::make_move_iterator(v.begin()), boost::make_move_iterator(v.end()));
|
||||
|
||||
//Test values have been moved
|
||||
if(!v[0].moved()){
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(v2.size() != 10){
|
||||
return 1;
|
||||
}
|
||||
BOOST_TEST(v[0].moved());
|
||||
BOOST_TEST(v2.size() == 10);
|
||||
|
||||
//Move again
|
||||
v.assign(boost::make_move_iterator(v2.begin()), boost::make_move_iterator(v2.end()));
|
||||
|
||||
//Test values have been moved
|
||||
if(!v2[0].moved()){
|
||||
return 1;
|
||||
}
|
||||
BOOST_TEST(v2[0].moved());
|
||||
BOOST_TEST(!v[0].moved());
|
||||
|
||||
if(v[0].moved()){
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ::boost::report_errors();
|
||||
}
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
Reference in New Issue
Block a user