disable_overload.hpp 935 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright Oliver Kowalke 2014.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_CONTEXT_DETAIL_DISABLE_OVERLOAD_H
  6. #define BOOST_CONTEXT_DETAIL_DISABLE_OVERLOAD_H
  7. #include <type_traits>
  8. #include <boost/config.hpp>
  9. #include <boost/context/detail/config.hpp>
  10. #ifdef BOOST_HAS_ABI_HEADERS
  11. # include BOOST_ABI_PREFIX
  12. #endif
  13. namespace boost {
  14. namespace context {
  15. namespace detail {
  16. // http://ericniebler.com/2013/08/07/universal-references-and-the-copy-constructo/
  17. template< typename X, typename Y >
  18. using disable_overload =
  19. typename std::enable_if<
  20. ! std::is_base_of<
  21. X,
  22. typename std::decay< Y >::type
  23. >::value
  24. >::type;
  25. }}}
  26. #ifdef BOOST_HAS_ABI_HEADERS
  27. #include BOOST_ABI_SUFFIX
  28. #endif
  29. #endif // BOOST_CONTEXT_DETAIL_DISABLE_OVERLOAD_H