Ticket #8189: type_traits.patch

File type_traits.patch, 68.5 KB (added by Antony Polukhin, 10 years ago)

Initial patch (no documentation, but there are some tests)

  • boost/type_traits/intrinsics.hpp

     
    2424// BOOST_IS_EMPTY(T) should evaluate to true if T is an empty class type (and not a union)
    2525// BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) should evaluate to true if "T x;" has no effect
    2626// BOOST_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy
     27// BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) should evaluate to true if T(boost::move(t)) <==> memcpy
    2728// BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy
     29// BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) should evaluate to true if t = boost::move(u) <==> memcpy
    2830// BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect
    2931// BOOST_HAS_NOTHROW_CONSTRUCTOR(T) should evaluate to true if "T x;" can not throw
    3032// BOOST_HAS_NOTHROW_COPY(T) should evaluate to true if T(t) can not throw
  • boost/type_traits/has_nothrow_move_assign.hpp

     
     1
     2//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
     3//  (C) Copyright Eric Friedman 2002-2003.
     4//  (C) Copyright Antony Polukhin 2013.
     5//  Use, modification and distribution are subject to the Boost Software License,
     6//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     7//  http://www.boost.org/LICENSE_1_0.txt).
     8//
     9//  See http://www.boost.org/libs/type_traits for most recent version including documentation.
     10
     11#ifndef BOOST_TT_HAS_NOTHROW_MOVE_ASSIGN_HPP_INCLUDED
     12#define BOOST_TT_HAS_NOTHROW_MOVE_ASSIGN_HPP_INCLUDED
     13
     14#include <boost/config.hpp>
     15#include <boost/type_traits/has_trivial_move_assign.hpp>
     16#include <boost/type_traits/has_nothrow_assign.hpp>
     17
     18// should be the last #include
     19#include <boost/type_traits/detail/bool_trait_def.hpp>
     20
     21namespace boost {
     22
     23namespace detail{
     24
     25template <class T>
     26struct has_nothrow_move_assign_imp{
     27#ifndef BOOST_NO_CXX11_NOEXCEPT
     28   BOOST_STATIC_CONSTANT(bool, value = (
     29        ::boost::type_traits::ice_or<
     30            ::boost::has_trivial_move_assign<T>::value,
     31            BOOST_NOEXCEPT_EXPR(::boost::declval<T>() = ::boost::declval<T>())
     32        >::value));
     33#else
     34   BOOST_STATIC_CONSTANT(bool, value = (
     35        ::boost::type_traits::ice_or<
     36            ::boost::has_trivial_move_assign<T>::value,
     37            ::boost::has_nothrow_assign<T>::value
     38        >::value));
     39#endif
     40};
     41
     42}
     43
     44BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_move_assign,T,::boost::detail::has_nothrow_move_assign_imp<T>::value)
     45BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_assign,void,false)
     46#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
     47BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_assign,void const,false)
     48BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_assign,void const volatile,false)
     49BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_assign,void volatile,false)
     50#endif
     51
     52} // namespace boost
     53
     54#include <boost/type_traits/detail/bool_trait_undef.hpp>
     55
     56#endif // BOOST_TT_HAS_NOTHROW_MOVE_ASSIGN_HPP_INCLUDED
  • boost/type_traits/has_trivial_move_assign.hpp

    Property changes on: boost/type_traits/has_nothrow_move_assign.hpp
    ___________________________________________________________________
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
     
     1
     2//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
     3//  (C) Copyright Eric Friedman 2002-2003.
     4//  (C) Copyright Antony Polukhin 2013.
     5//  Use, modification and distribution are subject to the Boost Software License,
     6//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     7//  http://www.boost.org/LICENSE_1_0.txt).
     8//
     9//  See http://www.boost.org/libs/type_traits for most recent version including documentation.
     10
     11#ifndef BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
     12#define BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
     13
     14#include <boost/type_traits/config.hpp>
     15#include <boost/type_traits/is_pod.hpp>
     16#include <boost/type_traits/has_trivial_assign.hpp>
     17#include <boost/type_traits/detail/ice_or.hpp>
     18
     19// should be the last #include
     20#include <boost/type_traits/detail/bool_trait_def.hpp>
     21
     22namespace boost {
     23
     24namespace detail {
     25
     26template <typename T>
     27struct has_trivial_move_assign_impl
     28{
     29#ifdef BOOST_HAS_TRIVIAL_MOVE_ASSIGN
     30   BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)));
     31#else
     32   BOOST_STATIC_CONSTANT(bool, value = (::boost::has_trivial_assign<T>::value));
     33#endif
     34};
     35
     36} // namespace detail
     37
     38BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_assign,T,::boost::detail::has_trivial_move_assign_impl<T>::value)
     39BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void,false)
     40#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
     41BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const,false)
     42BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const volatile,false)
     43BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void volatile,false)
     44#endif
     45
     46} // namespace boost
     47
     48#include <boost/type_traits/detail/bool_trait_undef.hpp>
     49
     50#endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
  • boost/type_traits/has_nothrow_move_constructor.hpp

    Property changes on: boost/type_traits/has_trivial_move_assign.hpp
    ___________________________________________________________________
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
     
     1
     2//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
     3//  (C) Copyright Eric Friedman 2002-2003.
     4//  (C) Copyright Antony Polukhin 2013.
     5//  Use, modification and distribution are subject to the Boost Software License,
     6//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     7//  http://www.boost.org/LICENSE_1_0.txt).
     8//
     9//  See http://www.boost.org/libs/type_traits for most recent version including documentation.
     10
     11#ifndef BOOST_TT_HAS_NOTHROW_MOVE_CONSTRUCTOR_HPP_INCLUDED
     12#define BOOST_TT_HAS_NOTHROW_MOVE_CONSTRUCTOR_HPP_INCLUDED
     13
     14#include <boost/config.hpp>
     15#include <boost/type_traits/has_trivial_move_constructor.hpp>
     16#include <boost/type_traits/has_nothrow_copy.hpp>
     17#include <boost/type_traits/detail/ice_or.hpp>
     18#include <boost/utility/declval.hpp>
     19
     20// should be the last #include
     21#include <boost/type_traits/detail/bool_trait_def.hpp>
     22
     23namespace boost {
     24
     25namespace detail{
     26
     27template <class T>
     28struct has_nothrow_move_constructor_imp{
     29#ifndef BOOST_NO_CXX11_NOEXCEPT
     30   BOOST_STATIC_CONSTANT(bool, value =
     31        (::boost::type_traits::ice_or<
     32            ::boost::has_trivial_move_constructor<T>::value,
     33            BOOST_NOEXCEPT_EXPR(T(::boost::declval<T>()))
     34        >::value));
     35#else
     36   BOOST_STATIC_CONSTANT(bool, value =
     37        (::boost::type_traits::ice_or<
     38            ::boost::has_trivial_move_constructor<T>::value,
     39            ::boost::has_nothrow_copy<T>::value
     40        >::value));
     41#endif
     42};
     43
     44}
     45
     46BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_move_constructor,T,::boost::detail::has_nothrow_move_constructor_imp<T>::value)
     47
     48BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_constructor,void,false)
     49#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
     50BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_constructor,void const,false)
     51BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_constructor,void const volatile,false)
     52BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_constructor,void volatile,false)
     53#endif
     54
     55} // namespace boost
     56
     57#include <boost/type_traits/detail/bool_trait_undef.hpp>
     58
     59#endif // BOOST_TT_HAS_NOTHROW_MOVE_CONSTRUCTOR_HPP_INCLUDED
  • boost/type_traits/has_trivial_move_constructor.hpp

    Property changes on: boost/type_traits/has_nothrow_move_constructor.hpp
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
     
     1
     2//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
     3//  (C) Copyright Eric Friedman 2002-2003.
     4//  (C) Copyright Antony Polukhin 2013.
     5//  Use, modification and distribution are subject to the Boost Software License,
     6//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     7//  http://www.boost.org/LICENSE_1_0.txt).
     8//
     9//  See http://www.boost.org/libs/type_traits for most recent version including documentation.
     10
     11#ifndef BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED
     12#define BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED
     13
     14#include <boost/type_traits/config.hpp>
     15#include <boost/type_traits/intrinsics.hpp>
     16#include <boost/type_traits/is_pod.hpp>
     17#include "boost/type_traits/has_trivial_copy.hpp"
     18#include <boost/type_traits/detail/ice_or.hpp>
     19
     20// should be the last #include
     21#include <boost/type_traits/detail/bool_trait_def.hpp>
     22
     23namespace boost {
     24
     25namespace detail {
     26
     27template <typename T>
     28struct has_trivial_move_ctor_impl
     29{
     30#ifdef BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR
     31   BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)));
     32#else
     33   BOOST_STATIC_CONSTANT(bool, value = (::boost::has_trivial_copy<T>::value));
     34#endif
     35};
     36
     37} // namespace detail
     38
     39BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_constructor,T,::boost::detail::has_trivial_move_ctor_impl<T>::value)
     40
     41} // namespace boost
     42
     43#include <boost/type_traits/detail/bool_trait_undef.hpp>
     44
     45#endif // BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED
  • libs/type_traits/test/has_trivial_move_constructor_test.cpp

    Property changes on: boost/type_traits/has_trivial_move_constructor.hpp
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
     
     1
     2//  (C) Copyright John Maddock 2000.
     3//  (C) Copyright Antony Polukhin 2013.
     4//  Use, modification and distribution are subject to the
     5//  Boost Software License, Version 1.0. (See accompanying file
     6//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     7
     8#include "test.hpp"
     9#include "check_integral_constant.hpp"
     10#ifdef TEST_STD
     11#  include <type_traits>
     12#else
     13#  include <boost/type_traits/has_trivial_move_constructor.hpp>
     14#endif
     15
     16TT_TEST_BEGIN(has_trivial_move_constructor)
     17
     18BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<bool>::value, true);
     19BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<bool const>::value, true);
     20#ifndef TEST_STD
     21// unspecified behaviour:
     22BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<bool volatile>::value, false);
     23BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<bool const volatile>::value, false);
     24#endif
     25
     26BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<signed char>::value, true);
     27BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<signed char const>::value, true);
     28#ifndef TEST_STD
     29// unspecified behaviour:
     30BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<signed char volatile>::value, false);
     31BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<signed char const volatile>::value, false);
     32#endif
     33BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned char>::value, true);
     34BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<char>::value, true);
     35BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned char const>::value, true);
     36BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<char const>::value, true);
     37#ifndef TEST_STD
     38// unspecified behaviour:
     39BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned char volatile>::value, false);
     40BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<char volatile>::value, false);
     41BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned char const volatile>::value, false);
     42BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<char const volatile>::value, false);
     43#endif
     44
     45BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned short>::value, true);
     46BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<short>::value, true);
     47BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned short const>::value, true);
     48BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<short const>::value, true);
     49#ifndef TEST_STD
     50// unspecified behaviour:
     51BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned short volatile>::value, false);
     52BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<short volatile>::value, false);
     53BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned short const volatile>::value, false);
     54BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<short const volatile>::value, false);
     55#endif
     56
     57BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned int>::value, true);
     58BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int>::value, true);
     59BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned int const>::value, true);
     60BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int const>::value, true);
     61#ifndef TEST_STD
     62// unspecified behaviour:
     63BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned int volatile>::value, false);
     64BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int volatile>::value, false);
     65BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned int const volatile>::value, false);
     66BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int const volatile>::value, false);
     67#endif
     68
     69BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned long>::value, true);
     70BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long>::value, true);
     71BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned long const>::value, true);
     72BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long const>::value, true);
     73#ifndef TEST_STD
     74// unspecified behaviour:
     75BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned long volatile>::value, false);
     76BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long volatile>::value, false);
     77BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned long const volatile>::value, false);
     78BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long const volatile>::value, false);
     79#endif
     80#ifdef BOOST_HAS_LONG_LONG
     81
     82BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type>::value, true);
     83BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type>::value, true);
     84BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type const>::value, true);
     85BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type const>::value, true);
     86#ifndef TEST_STD
     87// unspecified behaviour:
     88BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type volatile>::value, false);
     89BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type volatile>::value, false);
     90BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type const volatile>::value, false);
     91BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type const volatile>::value, false);
     92#endif
     93#endif
     94
     95#ifdef BOOST_HAS_MS_INT64
     96
     97BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int8>::value, true);
     98BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8>::value, true);
     99BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int8 const>::value, true);
     100BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8 const>::value, true);
     101#ifndef TEST_STD
     102// unspecified behaviour:
     103BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int8 volatile>::value, false);
     104BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8 volatile>::value, false);
     105BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int8 const volatile>::value, false);
     106BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8 const volatile>::value, false);
     107#endif
     108BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int16>::value, true);
     109BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16>::value, true);
     110BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int16 const>::value, true);
     111BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16 const>::value, true);
     112#ifndef TEST_STD
     113// unspecified behaviour:
     114BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int16 volatile>::value, false);
     115BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16 volatile>::value, false);
     116BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int16 const volatile>::value, false);
     117BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16 const volatile>::value, false);
     118#endif
     119BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int32>::value, true);
     120BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32>::value, true);
     121BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int32 const>::value, true);
     122BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32 const>::value, true);
     123#ifndef TEST_STD
     124// unspecified behaviour:
     125BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int32 volatile>::value, false);
     126BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32 volatile>::value, false);
     127BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int32 const volatile>::value, false);
     128BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32 const volatile>::value, false);
     129#endif
     130BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int64>::value, true);
     131BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64>::value, true);
     132BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int64 const>::value, true);
     133BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64 const>::value, true);
     134#ifndef TEST_STD
     135// unspecified behaviour:
     136BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int64 volatile>::value, false);
     137BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64 volatile>::value, false);
     138BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int64 const volatile>::value, false);
     139BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64 const volatile>::value, false);
     140#endif
     141#endif
     142
     143BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<float>::value, true);
     144BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<float const>::value, true);
     145#ifndef TEST_STD
     146// unspecified behaviour:
     147BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<float volatile>::value, false);
     148BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<float const volatile>::value, false);
     149#endif
     150
     151BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<double>::value, true);
     152BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<double const>::value, true);
     153#ifndef TEST_STD
     154// unspecified behaviour:
     155BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<double volatile>::value, false);
     156BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<double const volatile>::value, false);
     157#endif
     158
     159BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long double>::value, true);
     160BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long double const>::value, true);
     161#ifndef TEST_STD
     162// unspecified behaviour:
     163BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long double volatile>::value, false);
     164BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long double const volatile>::value, false);
     165#endif
     166
     167BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int>::value, true);
     168BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<void*>::value, true);
     169BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int*const>::value, true);
     170BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<f1>::value, true);
     171BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<f2>::value, true);
     172BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<f3>::value, true);
     173BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<mf1>::value, true);
     174BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<mf2>::value, true);
     175BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<mf3>::value, true);
     176BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<mp>::value, true);
     177BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<cmf>::value, true);
     178BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<enum_UDT>::value, true);
     179
     180BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int&>::value, false);
     181#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
     182BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int&&>::value, false);
     183#endif
     184BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<const int&>::value, false);
     185BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int[2]>::value, true);
     186BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int[3][2]>::value, true);
     187BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int[2][4][5][6][3]>::value, true);
     188BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<UDT>::value, false);
     189BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<void>::value, false);
     190// cases we would like to succeed but can't implement in the language:
     191BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<empty_POD_UDT>::value, true, false);
     192BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<POD_UDT>::value, true, false);
     193BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<POD_union_UDT>::value, true, false);
     194BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<empty_POD_union_UDT>::value, true, false);
     195
     196BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<trivial_except_copy>::value, false);
     197BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<trivial_except_destroy>::value, true, false);
     198BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<trivial_except_construct>::value, true, false);
     199BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<trivial_except_assign>::value, true, false);
     200BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<wrap<trivial_except_copy> >::value, false);
     201BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<wrap<trivial_except_destroy> >::value, true, false);
     202BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<wrap<trivial_except_construct> >::value, true, false);
     203BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<wrap<trivial_except_assign> >::value, true, false);
     204
     205BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<test_abc1>::value, false);
     206
     207TT_TEST_END
     208
     209
     210
     211
     212
     213
     214
     215
  • libs/type_traits/test/has_nothrow_move_assign_test.cpp

    Property changes on: libs/type_traits/test/has_trivial_move_constructor_test.cpp
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
     
     1
     2//  (C) Copyright John Maddock 2000.
     3//  (C) Copyright Antony Polukhin 2013.
     4//  Use, modification and distribution are subject to the
     5//  Boost Software License, Version 1.0. (See accompanying file
     6//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     7
     8#include "test.hpp"
     9#include "check_integral_constant.hpp"
     10#ifdef TEST_STD
     11#  include <type_traits>
     12#else
     13#  include <boost/type_traits/has_nothrow_move_assign.hpp>
     14#endif
     15
     16TT_TEST_BEGIN(has_nothrow_move_assign)
     17
     18BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<bool>::value, true);
     19#ifndef TEST_STD
     20// unspecified behaviour:
     21BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<bool const>::value, false);
     22BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<bool volatile>::value, false);
     23BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<bool const volatile>::value, false);
     24#endif
     25
     26BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<signed char>::value, true);
     27#ifndef TEST_STD
     28// unspecified behaviour:
     29BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<signed char const>::value, false);
     30BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<signed char volatile>::value, false);
     31BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<signed char const volatile>::value, false);
     32#endif
     33BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned char>::value, true);
     34BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<char>::value, true);
     35#ifndef TEST_STD
     36// unspecified behaviour:
     37BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned char const>::value, false);
     38BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<char const>::value, false);
     39BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned char volatile>::value, false);
     40BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<char volatile>::value, false);
     41BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned char const volatile>::value, false);
     42BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<char const volatile>::value, false);
     43#endif
     44
     45BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned short>::value, true);
     46BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<short>::value, true);
     47#ifndef TEST_STD
     48// unspecified behaviour:
     49BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned short const>::value, false);
     50BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<short const>::value, false);
     51BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned short volatile>::value, false);
     52BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<short volatile>::value, false);
     53BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned short const volatile>::value, false);
     54BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<short const volatile>::value, false);
     55#endif
     56
     57BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned int>::value, true);
     58BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int>::value, true);
     59#ifndef TEST_STD
     60// unspecified behaviour:
     61BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned int const>::value, false);
     62BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int const>::value, false);
     63BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned int volatile>::value, false);
     64BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int volatile>::value, false);
     65BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned int const volatile>::value, false);
     66BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int const volatile>::value, false);
     67#endif
     68
     69BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned long>::value, true);
     70BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long>::value, true);
     71#ifndef TEST_STD
     72// unspecified behaviour:
     73BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned long const>::value, false);
     74BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long const>::value, false);
     75BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned long volatile>::value, false);
     76BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long volatile>::value, false);
     77BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned long const volatile>::value, false);
     78BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long const volatile>::value, false);
     79#endif
     80
     81#ifdef BOOST_HAS_LONG_LONG
     82
     83BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::ulong_long_type>::value, true);
     84BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::long_long_type>::value, true);
     85#ifndef TEST_STD
     86// unspecified behaviour:
     87BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::ulong_long_type const>::value, false);
     88BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::long_long_type const>::value, false);
     89BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::ulong_long_type volatile>::value, false);
     90BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::long_long_type volatile>::value, false);
     91BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::ulong_long_type const volatile>::value, false);
     92BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::long_long_type const volatile>::value, false);
     93#endif
     94#endif
     95
     96#ifdef BOOST_HAS_MS_INT64
     97
     98BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int8>::value, true);
     99BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int8>::value, true);
     100#ifndef TEST_STD
     101// unspecified behaviour:
     102BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int8 const>::value, false);
     103BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int8 const>::value, false);
     104BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int8 volatile>::value, false);
     105BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int8 volatile>::value, false);
     106BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int8 const volatile>::value, false);
     107BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int8 const volatile>::value, false);
     108#endif
     109
     110BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int16>::value, true);
     111BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int16>::value, true);
     112#ifndef TEST_STD
     113// unspecified behaviour:
     114BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int16 const>::value, false);
     115BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int16 const>::value, false);
     116BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int16 volatile>::value, false);
     117BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int16 volatile>::value, false);
     118BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int16 const volatile>::value, false);
     119BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int16 const volatile>::value, false);
     120#endif
     121
     122BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int32>::value, true);
     123BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int32>::value, true);
     124#ifndef TEST_STD
     125// unspecified behaviour:
     126BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int32 const>::value, false);
     127BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int32 const>::value, false);
     128BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int32 volatile>::value, false);
     129BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int32 volatile>::value, false);
     130BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int32 const volatile>::value, false);
     131BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int32 const volatile>::value, false);
     132#endif
     133
     134BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int64>::value, true);
     135BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int64>::value, true);
     136#ifndef TEST_STD
     137// unspecified behaviour:
     138BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int64 const>::value, false);
     139BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int64 const>::value, false);
     140BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int64 volatile>::value, false);
     141BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int64 volatile>::value, false);
     142BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int64 const volatile>::value, false);
     143BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int64 const volatile>::value, false);
     144#endif
     145#endif
     146
     147BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<float>::value, true);
     148#ifndef TEST_STD
     149// unspecified behaviour:
     150BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<float const>::value, false);
     151BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<float volatile>::value, false);
     152BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<float const volatile>::value, false);
     153#endif
     154
     155BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<double>::value, true);
     156#ifndef TEST_STD
     157// unspecified behaviour:
     158BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<double const>::value, false);
     159BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<double volatile>::value, false);
     160BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<double const volatile>::value, false);
     161#endif
     162
     163BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long double>::value, true);
     164#ifndef TEST_STD
     165// unspecified behaviour:
     166BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long double const>::value, false);
     167BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long double volatile>::value, false);
     168BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long double const volatile>::value, false);
     169#endif
     170
     171BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int>::value, true);
     172BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<void*>::value, true);
     173#ifndef TEST_STD
     174// unspecified behaviour:
     175BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int*const>::value, false);
     176#endif
     177BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<f1>::value, true);
     178BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<f2>::value, true);
     179BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<f3>::value, true);
     180BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<mf1>::value, true);
     181BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<mf2>::value, true);
     182BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<mf3>::value, true);
     183BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<mp>::value, true);
     184BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<cmf>::value, true);
     185BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<enum_UDT>::value, true);
     186
     187BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int&>::value, false);
     188#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
     189BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int&&>::value, false);
     190#endif
     191BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<const int&>::value, false);
     192BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int[2]>::value, true);
     193BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int[3][2]>::value, true);
     194BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int[2][4][5][6][3]>::value, true);
     195BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<UDT>::value, false);
     196BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<empty_UDT>::value, false);
     197BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<void>::value, false);
     198// cases we would like to succeed but can't implement in the language:
     199BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<empty_POD_UDT>::value, true, false);
     200BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<POD_UDT>::value, true, false);
     201BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<POD_union_UDT>::value, true, false);
     202BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<empty_POD_union_UDT>::value, true, false);
     203BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<nothrow_assign_UDT>::value, true, false);
     204BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<nothrow_copy_UDT>::value, false);
     205BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<nothrow_construct_UDT>::value, false);
     206
     207BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<test_abc1>::value, false);
     208
     209TT_TEST_END
     210
     211
     212
  • libs/type_traits/test/has_trivial_move_assign_test.cpp

    Property changes on: libs/type_traits/test/has_nothrow_move_assign_test.cpp
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
     
     1
     2//  (C) Copyright John Maddock 2000.
     3//  (C) Copyright Antony Polukhin 2013.
     4//  Use, modification and distribution are subject to the
     5//  Boost Software License, Version 1.0. (See accompanying file
     6//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     7
     8#include "test.hpp"
     9#include "check_integral_constant.hpp"
     10#ifdef TEST_STD
     11#  include <type_traits>
     12#else
     13#  include <boost/type_traits/has_trivial_move_assign.hpp>
     14#endif
     15
     16TT_TEST_BEGIN(has_trivial_move_assign)
     17
     18BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<bool>::value, true);
     19#ifndef TEST_STD
     20// unspecified behaviour:
     21BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<bool const>::value, false);
     22BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<bool volatile>::value, false);
     23BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<bool const volatile>::value, false);
     24#endif
     25
     26BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<signed char>::value, true);
     27#ifndef TEST_STD
     28// unspecified behaviour:
     29BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<signed char const>::value, false);
     30BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<signed char volatile>::value, false);
     31BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<signed char const volatile>::value, false);
     32#endif
     33BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned char>::value, true);
     34BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<char>::value, true);
     35#ifndef TEST_STD
     36// unspecified behaviour:
     37BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned char const>::value, false);
     38BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<char const>::value, false);
     39BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned char volatile>::value, false);
     40BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<char volatile>::value, false);
     41BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned char const volatile>::value, false);
     42BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<char const volatile>::value, false);
     43#endif
     44
     45BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned short>::value, true);
     46BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<short>::value, true);
     47#ifndef TEST_STD
     48// unspecified behaviour:
     49BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned short const>::value, false);
     50BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<short const>::value, false);
     51BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned short volatile>::value, false);
     52BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<short volatile>::value, false);
     53BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned short const volatile>::value, false);
     54BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<short const volatile>::value, false);
     55#endif
     56BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned int>::value, true);
     57BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int>::value, true);
     58#ifndef TEST_STD
     59// unspecified behaviour:
     60BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned int const>::value, false);
     61BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int const>::value, false);
     62BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned int volatile>::value, false);
     63BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int volatile>::value, false);
     64BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned int const volatile>::value, false);
     65BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int const volatile>::value, false);
     66#endif
     67BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned long>::value, true);
     68BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long>::value, true);
     69#ifndef TEST_STD
     70// unspecified behaviour:
     71BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned long const>::value, false);
     72BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long const>::value, false);
     73BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned long volatile>::value, false);
     74BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long volatile>::value, false);
     75BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned long const volatile>::value, false);
     76BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long const volatile>::value, false);
     77#endif
     78#ifdef BOOST_HAS_LONG_LONG
     79
     80BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type>::value, true);
     81BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type>::value, true);
     82#ifndef TEST_STD
     83// unspecified behaviour:
     84BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type const>::value, false);
     85BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type const>::value, false);
     86BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type volatile>::value, false);
     87BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type volatile>::value, false);
     88BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type const volatile>::value, false);
     89BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type const volatile>::value, false);
     90#endif
     91#endif
     92
     93#ifdef BOOST_HAS_MS_INT64
     94
     95BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int8>::value, true);
     96BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8>::value, true);
     97#ifndef TEST_STD
     98// unspecified behaviour:
     99BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int8 const>::value, false);
     100BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8 const>::value, false);
     101BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int8 volatile>::value, false);
     102BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8 volatile>::value, false);
     103BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int8 const volatile>::value, false);
     104BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8 const volatile>::value, false);
     105#endif
     106BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int16>::value, true);
     107BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16>::value, true);
     108#ifndef TEST_STD
     109// unspecified behaviour:
     110BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int16 const>::value, false);
     111BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16 const>::value, false);
     112BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int16 volatile>::value, false);
     113BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16 volatile>::value, false);
     114BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int16 const volatile>::value, false);
     115BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16 const volatile>::value, false);
     116#endif
     117BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int32>::value, true);
     118BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32>::value, true);
     119#ifndef TEST_STD
     120// unspecified behaviour:
     121BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int32 const>::value, false);
     122BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32 const>::value, false);
     123BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int32 volatile>::value, false);
     124BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32 volatile>::value, false);
     125BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int32 const volatile>::value, false);
     126BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32 const volatile>::value, false);
     127#endif
     128BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int64>::value, true);
     129BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64>::value, true);
     130#ifndef TEST_STD
     131// unspecified behaviour:
     132BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int64 const>::value, false);
     133BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64 const>::value, false);
     134BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int64 volatile>::value, false);
     135BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64 volatile>::value, false);
     136BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int64 const volatile>::value, false);
     137BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64 const volatile>::value, false);
     138#endif
     139#endif
     140
     141BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<float>::value, true);
     142#ifndef TEST_STD
     143// unspecified behaviour:
     144BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<float const>::value, false);
     145BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<float volatile>::value, false);
     146BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<float const volatile>::value, false);
     147#endif
     148BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<double>::value, true);
     149#ifndef TEST_STD
     150// unspecified behaviour:
     151BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<double const>::value, false);
     152BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<double volatile>::value, false);
     153BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<double const volatile>::value, false);
     154#endif
     155BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long double>::value, true);
     156#ifndef TEST_STD
     157// unspecified behaviour:
     158BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long double const>::value, false);
     159BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long double volatile>::value, false);
     160BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long double const volatile>::value, false);
     161#endif
     162
     163BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int>::value, true);
     164BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<void*>::value, true);
     165#ifndef TEST_STD
     166// unspecified behaviour:
     167BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int*const>::value, false);
     168#endif
     169BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<f1>::value, true);
     170BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<f2>::value, true);
     171BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<f3>::value, true);
     172BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<mf1>::value, true);
     173BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<mf2>::value, true);
     174BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<mf3>::value, true);
     175BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<mp>::value, true);
     176BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<cmf>::value, true);
     177BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<enum_UDT>::value, true);
     178
     179BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int&>::value, false);
     180#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
     181BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int&&>::value, false);
     182#endif
     183BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<const int&>::value, false);
     184BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[2]>::value, true);
     185BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[3][2]>::value, true);
     186BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[2][4][5][6][3]>::value, true);
     187BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<UDT>::value, false);
     188BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<empty_UDT>::value, false);
     189BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<void>::value, false);
     190// cases we would like to succeed but can't implement in the language:
     191BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<empty_POD_UDT>::value, true, false);
     192BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<POD_UDT>::value, true, false);
     193BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<POD_union_UDT>::value, true, false);
     194BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<empty_POD_union_UDT>::value, true, false);
     195
     196BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<trivial_except_assign>::value, false);
     197BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<trivial_except_destroy>::value, true, false);
     198BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<trivial_except_construct>::value, true, false);
     199BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<trivial_except_copy>::value, true, false);
     200BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<wrap<trivial_except_assign> >::value, false);
     201BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<wrap<trivial_except_destroy> >::value, true, false);
     202BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<wrap<trivial_except_construct> >::value, true, false);
     203BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<wrap<trivial_except_copy> >::value, true, false);
     204
     205BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<test_abc1>::value, false);
     206
     207TT_TEST_END
     208
     209
     210
  • libs/type_traits/test/has_nothrow_move_constructor_test.cpp

    Property changes on: libs/type_traits/test/has_trivial_move_assign_test.cpp
    ___________________________________________________________________
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
     
     1
     2//  (C) Copyright John Maddock 2000.
     3//  (C) Copyright Antony Polukhin 2013.
     4//  Use, modification and distribution are subject to the
     5//  Boost Software License, Version 1.0. (See accompanying file
     6//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     7
     8#include "test.hpp"
     9#include "check_integral_constant.hpp"
     10#ifdef TEST_STD
     11#  include <type_traits>
     12#else
     13#  include <boost/type_traits/has_nothrow_move_constructor.hpp>
     14#endif
     15
     16TT_TEST_BEGIN(has_nothrow_move_constructor)
     17
     18BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<bool>::value, true);
     19BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<bool const>::value, true);
     20#ifndef TEST_STD
     21// unspecified behaviour:
     22BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<bool volatile>::value, false);
     23BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<bool const volatile>::value, false);
     24#endif
     25
     26BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<signed char>::value, true);
     27BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<signed char const>::value, true);
     28#ifndef TEST_STD
     29// unspecified behaviour:
     30BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<signed char volatile>::value, false);
     31BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<signed char const volatile>::value, false);
     32#endif
     33BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned char>::value, true);
     34BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<char>::value, true);
     35BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned char const>::value, true);
     36BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<char const>::value, true);
     37#ifndef TEST_STD
     38// unspecified behaviour:
     39BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned char volatile>::value, false);
     40BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<char volatile>::value, false);
     41BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned char const volatile>::value, false);
     42BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<char const volatile>::value, false);
     43#endif
     44
     45BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned short>::value, true);
     46BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<short>::value, true);
     47BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned short const>::value, true);
     48BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<short const>::value, true);
     49#ifndef TEST_STD
     50// unspecified behaviour:
     51BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned short volatile>::value, false);
     52BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<short volatile>::value, false);
     53BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned short const volatile>::value, false);
     54BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<short const volatile>::value, false);
     55#endif
     56
     57BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned int>::value, true);
     58BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int>::value, true);
     59BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned int const>::value, true);
     60BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int const>::value, true);
     61#ifndef TEST_STD
     62// unspecified behaviour:
     63BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned int volatile>::value, false);
     64BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int volatile>::value, false);
     65BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned int const volatile>::value, false);
     66BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int const volatile>::value, false);
     67#endif
     68
     69BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned long>::value, true);
     70BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long>::value, true);
     71BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned long const>::value, true);
     72BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long const>::value, true);
     73#ifndef TEST_STD
     74// unspecified behaviour:
     75BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned long volatile>::value, false);
     76BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long volatile>::value, false);
     77BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned long const volatile>::value, false);
     78BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long const volatile>::value, false);
     79#endif
     80
     81#ifdef BOOST_HAS_LONG_LONG
     82
     83BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::ulong_long_type>::value, true);
     84BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::long_long_type>::value, true);
     85BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::ulong_long_type const>::value, true);
     86BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::long_long_type const>::value, true);
     87#ifndef TEST_STD
     88// unspecified behaviour:
     89BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::ulong_long_type volatile>::value, false);
     90BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::long_long_type volatile>::value, false);
     91BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::ulong_long_type const volatile>::value, false);
     92BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::long_long_type const volatile>::value, false);
     93#endif
     94#endif
     95
     96#ifdef BOOST_HAS_MS_INT64
     97
     98BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int8>::value, true);
     99BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int8>::value, true);
     100BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int8 const>::value, true);
     101BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int8 const>::value, true);
     102#ifndef TEST_STD
     103// unspecified behaviour:
     104BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int8 volatile>::value, false);
     105BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int8 volatile>::value, false);
     106BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int8 const volatile>::value, false);
     107BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int8 const volatile>::value, false);
     108#endif
     109
     110BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int16>::value, true);
     111BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int16>::value, true);
     112BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int16 const>::value, true);
     113BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int16 const>::value, true);
     114#ifndef TEST_STD
     115// unspecified behaviour:
     116BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int16 volatile>::value, false);
     117BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int16 volatile>::value, false);
     118BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int16 const volatile>::value, false);
     119BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int16 const volatile>::value, false);
     120#endif
     121
     122BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int32>::value, true);
     123BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int32>::value, true);
     124BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int32 const>::value, true);
     125BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int32 const>::value, true);
     126#ifndef TEST_STD
     127// unspecified behaviour:
     128BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int32 volatile>::value, false);
     129BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int32 volatile>::value, false);
     130BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int32 const volatile>::value, false);
     131BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int32 const volatile>::value, false);
     132#endif
     133
     134BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int64>::value, true);
     135BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int64>::value, true);
     136BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int64 const>::value, true);
     137BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int64 const>::value, true);
     138#ifndef TEST_STD
     139// unspecified behaviour:
     140BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int64 volatile>::value, false);
     141BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int64 volatile>::value, false);
     142BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int64 const volatile>::value, false);
     143BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int64 const volatile>::value, false);
     144#endif
     145#endif
     146
     147BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<float>::value, true);
     148BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<float const>::value, true);
     149#ifndef TEST_STD
     150// unspecified behaviour:
     151BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<float volatile>::value, false);
     152BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<float const volatile>::value, false);
     153#endif
     154
     155BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<double>::value, true);
     156BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<double const>::value, true);
     157#ifndef TEST_STD
     158// unspecified behaviour:
     159BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<double volatile>::value, false);
     160BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<double const volatile>::value, false);
     161#endif
     162
     163BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long double>::value, true);
     164BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long double const>::value, true);
     165#ifndef TEST_STD
     166// unspecified behaviour:
     167BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long double volatile>::value, false);
     168BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long double const volatile>::value, false);
     169#endif
     170
     171BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int>::value, true);
     172BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<void*>::value, true);
     173BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int*const>::value, true);
     174BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<f1>::value, true);
     175BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<f2>::value, true);
     176BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<f3>::value, true);
     177BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<mf1>::value, true);
     178BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<mf2>::value, true);
     179BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<mf3>::value, true);
     180BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<mp>::value, true);
     181BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<cmf>::value, true);
     182BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<enum_UDT>::value, true);
     183
     184BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int&>::value, false);
     185#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
     186BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int&&>::value, false);
     187#endif
     188BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<const int&>::value, false);
     189BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int[2]>::value, true);
     190BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int[3][2]>::value, true);
     191BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int[2][4][5][6][3]>::value, true);
     192BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<UDT>::value, false);
     193BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<void>::value, false);
     194// cases we would like to succeed but can't implement in the language:
     195BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<empty_POD_UDT>::value, true, false);
     196BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<POD_UDT>::value, true, false);
     197BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<POD_union_UDT>::value, true, false);
     198BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<empty_POD_union_UDT>::value, true, false);
     199BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<nothrow_copy_UDT>::value, true, false);
     200BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<nothrow_assign_UDT>::value, false);
     201BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<nothrow_construct_UDT>::value, false);
     202
     203BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<test_abc1>::value, false);
     204
     205TT_TEST_END
     206
     207
     208
  • libs/type_traits/doc/intrinsics.qbk

    Property changes on: libs/type_traits/test/has_nothrow_move_constructor_test.cpp
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
     
    1010There are some traits that can not be implemented within the current C++ language:
    1111to make these traits "just work" with user defined types, some kind of additional
    1212help from the compiler is required.  Currently (April 2008) Visual C++ 8 and 9,
    13 GNU GCC 4.3 and MWCW 9
    14 provide the necessary intrinsics, and other compilers will no doubt follow in due
    15 course. 
     13GNU GCC 4.3 and MWCW 9 provide at least some of the the necessary intrinsics,
     14and other compilers will no doubt follow in due course. 
    1615
    1716The Following traits classes always need compiler support to do the right thing
    1817for all types
     
    2221* __is_pod
    2322* __has_trivial_constructor
    2423* __has_trivial_copy
     24* __has_trivial_move_constructor
    2525* __has_trivial_assign
     26* __has_trivial_move_assign
    2627* __has_trivial_destructor
    2728* __has_nothrow_constructor
    2829* __has_nothrow_copy
     
    5152   [[BOOST_IS_EMPTY(T)][Should evaluate to true if T is an empty struct or union]]
    5253   [[BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)][Should evaluate to true if the default constructor for T is trivial (i.e. has no effect)]]
    5354   [[BOOST_HAS_TRIVIAL_COPY(T)][Should evaluate to true if T has a trivial copy constructor (and can therefore be replaced by a call to memcpy)]]
     55   [[BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)][Should evaluate to true if T has a trivial move constructor (and can therefore be replaced by a call to memcpy)]]
    5456   [[BOOST_HAS_TRIVIAL_ASSIGN(T)][Should evaluate to true if T has a trivial assignment operator (and can therefore be replaced by a call to memcpy)]]
     57   [[BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)][Should evaluate to true if T has a trivial move assignment operator (and can therefore be replaced by a call to memcpy)]]
    5558   [[BOOST_HAS_TRIVIAL_DESTRUCTOR(T)][Should evaluate to true if T has a trivial destructor (i.e. ~T() has no effect)]]
    5659   [[BOOST_HAS_NOTHROW_CONSTRUCTOR(T)][Should evaluate to true if `T x;` can not throw]]
    5760   [[BOOST_HAS_NOTHROW_COPY(T)][Should evaluate to true if `T(t)` can not throw]]