std_placeholders.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
  2. #define BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. // Copyright 2021 Peter Dimov
  8. // Distributed under the Boost Software License, Version 1.0.
  9. // https://www.boost.org/LICENSE_1_0.txt
  10. #include <boost/is_placeholder.hpp>
  11. #include <boost/config.hpp>
  12. #if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
  13. #include <functional>
  14. #include <type_traits>
  15. namespace boost
  16. {
  17. template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_1)>::type > { enum _vt { value = 1 }; };
  18. template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_2)>::type > { enum _vt { value = 2 }; };
  19. template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_3)>::type > { enum _vt { value = 3 }; };
  20. template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_4)>::type > { enum _vt { value = 4 }; };
  21. template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_5)>::type > { enum _vt { value = 5 }; };
  22. template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_6)>::type > { enum _vt { value = 6 }; };
  23. template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_7)>::type > { enum _vt { value = 7 }; };
  24. template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_8)>::type > { enum _vt { value = 8 }; };
  25. template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_9)>::type > { enum _vt { value = 9 }; };
  26. } // namespace boost
  27. #endif
  28. #endif // #ifndef BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED