is_function.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright 2003-2019 Joaquin M Lopez Munoz.
  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. *
  6. * See http://www.boost.org/libs/multi_index for library home page.
  7. */
  8. #ifndef BOOST_MULTI_INDEX_DETAIL_IS_FUNCTION_HPP
  9. #define BOOST_MULTI_INDEX_DETAIL_IS_FUNCTION_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
  14. #include <boost/detail/workaround.hpp>
  15. #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)||\
  16. BOOST_WORKAROUND(_LIBCPP_VERSION,<30700)||\
  17. BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<40802)
  18. /* libc++: std::is_function<void() const> fails,
  19. * https://bugs.llvm.org/show_bug.cgi?id=20084
  20. *
  21. * libstdc++-v3: std::is_function does not support ref-qualified function types,
  22. * https://github.com/gcc-mirror/gcc/commit/
  23. * 2fa630fb50ba29d8e891c52a75aaec261b07874e#
  24. * diff-6547f965a8d66bf35a6388fcf404aaa3
  25. */
  26. #include <boost/type_traits/is_function.hpp>
  27. namespace boost{namespace multi_index{namespace detail{
  28. template<typename T>
  29. struct is_function:boost::is_function<T>{};
  30. }}} /* namespace boost::multi_index::detail */
  31. #else
  32. #include <type_traits>
  33. namespace boost{namespace multi_index{namespace detail{
  34. template<typename T>
  35. struct is_function:std::is_function<T>{};
  36. }}} /* namespace boost::multi_index::detail */
  37. #endif
  38. #endif