is_convertible.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 2011-2013 Vicente J. Botet Escriba
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // See http://www.boost.org/libs/thread for documentation.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. #ifndef BOOST_THREAD_DETAIL_IS_CONVERTIBLE_HPP
  12. #define BOOST_THREAD_DETAIL_IS_CONVERTIBLE_HPP
  13. #include <boost/type_traits/is_convertible.hpp>
  14. #include <boost/thread/detail/move.hpp>
  15. namespace boost
  16. {
  17. namespace thread_detail
  18. {
  19. template <typename T1, typename T2>
  20. struct is_convertible : boost::is_convertible<T1,T2> {};
  21. #if defined BOOST_NO_CXX11_RVALUE_REFERENCES
  22. #if defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 1300)
  23. #if defined BOOST_THREAD_USES_MOVE
  24. template <typename T1, typename T2>
  25. struct is_convertible<
  26. rv<T1> &,
  27. rv<rv<T2> > &
  28. > : false_type {};
  29. #endif
  30. #elif defined __GNUC__ && (__GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ <= 4 ))
  31. template <typename T1, typename T2>
  32. struct is_convertible<T1&, T2&> : boost::is_convertible<T1, T2> {};
  33. #endif
  34. #endif
  35. }
  36. } // namespace boost
  37. #endif // BOOST_THREAD_DETAIL_MEMORY_HPP