bind.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef BOOST_BIND_HPP_INCLUDED
  2. #define BOOST_BIND_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. // bind.hpp - binds function objects to arguments
  8. //
  9. // Copyright (c) 2009, 2015 Peter Dimov
  10. //
  11. // Distributed under the Boost Software License, Version 1.0.
  12. // See accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt
  14. //
  15. // See http://www.boost.org/libs/bind/bind.html for documentation.
  16. //
  17. // For backward compatibility, this header includes
  18. // <boost/bind/bind.hpp> and then imports the placeholders _1, _2,
  19. // _3, ... into the global namespace. Definitions in the global
  20. // namespace are not a good practice and this use is deprecated.
  21. // Please switch to including <boost/bind/bind.hpp> directly,
  22. // adding the using directive locally where appropriate.
  23. // Alternatively, the existing behavior may be preserved by defining
  24. // the macro BOOST_BIND_GLOBAL_PLACEHOLDERS.
  25. #include <boost/bind/bind.hpp>
  26. #include <boost/config/pragma_message.hpp>
  27. #define BOOST_BIND_GLOBAL_PLACEHOLDERS
  28. #ifndef BOOST_BIND_NO_PLACEHOLDERS
  29. #if !defined(BOOST_BIND_GLOBAL_PLACEHOLDERS)
  30. BOOST_PRAGMA_MESSAGE(
  31. "The practice of declaring the Bind placeholders (_1, _2, ...) "
  32. "in the global namespace is deprecated. Please use "
  33. "<boost/bind/bind.hpp> + using namespace boost::placeholders, "
  34. "or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior."
  35. )
  36. #endif
  37. #if defined(BOOST_CLANG)
  38. # pragma clang diagnostic push
  39. # if __has_warning("-Wheader-hygiene")
  40. # pragma clang diagnostic ignored "-Wheader-hygiene"
  41. # endif
  42. #endif
  43. using namespace boost::placeholders;
  44. #if defined(BOOST_CLANG)
  45. # pragma clang diagnostic pop
  46. #endif
  47. #endif // #ifndef BOOST_BIND_NO_PLACEHOLDERS
  48. #endif // #ifndef BOOST_BIND_HPP_INCLUDED