imgtools/imglib/boostlibrary/boost/thread/detail/move.hpp
changeset 0 044383f39525
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 // Distributed under the Boost Software License, Version 1.0. (See
       
     2 // accompanying file LICENSE_1_0.txt or copy at
       
     3 // http://www.boost.org/LICENSE_1_0.txt)
       
     4 // (C) Copyright 2007-8 Anthony Williams
       
     5 
       
     6 #ifndef BOOST_THREAD_MOVE_HPP
       
     7 #define BOOST_THREAD_MOVE_HPP
       
     8 
       
     9 #ifndef BOOST_NO_SFINAE
       
    10 #include <boost/utility/enable_if.hpp>
       
    11 #include <boost/type_traits/is_convertible.hpp>
       
    12 #endif
       
    13 
       
    14 #include <boost/config/abi_prefix.hpp>
       
    15 
       
    16 namespace boost
       
    17 {
       
    18     namespace detail
       
    19     {
       
    20         template<typename T>
       
    21         struct thread_move_t
       
    22         {
       
    23             T& t;
       
    24             explicit thread_move_t(T& t_):
       
    25                 t(t_)
       
    26             {}
       
    27 
       
    28             T& operator*() const
       
    29             {
       
    30                 return t;
       
    31             }
       
    32 
       
    33             T* operator->() const
       
    34             {
       
    35                 return &t;
       
    36             }
       
    37         private:
       
    38             void operator=(thread_move_t&);
       
    39         };
       
    40     }
       
    41 
       
    42 #ifndef BOOST_NO_SFINAE
       
    43     template<typename T>
       
    44     typename enable_if<boost::is_convertible<T&,detail::thread_move_t<T> >, T >::type move(T& t)
       
    45     {
       
    46         return T(detail::thread_move_t<T>(t));
       
    47     }
       
    48 #endif
       
    49     
       
    50     template<typename T>
       
    51     detail::thread_move_t<T> move(detail::thread_move_t<T> t)
       
    52     {
       
    53         return t;
       
    54     }
       
    55     
       
    56 }
       
    57 
       
    58 #include <boost/config/abi_suffix.hpp>
       
    59 
       
    60 #endif