arg.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef BOOST_BIND_ARG_HPP_INCLUDED
  2. #define BOOST_BIND_ARG_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. //
  8. // bind/arg.hpp
  9. //
  10. // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
  11. //
  12. // Distributed under the Boost Software License, Version 1.0. (See
  13. // accompanying file LICENSE_1_0.txt or copy at
  14. // http://www.boost.org/LICENSE_1_0.txt)
  15. //
  16. // See http://www.boost.org/libs/bind/bind.html for documentation.
  17. //
  18. #include <boost/config.hpp>
  19. #include <boost/is_placeholder.hpp>
  20. namespace boost
  21. {
  22. template<bool Eq> struct _arg_eq
  23. {
  24. };
  25. template<> struct _arg_eq<true>
  26. {
  27. typedef void type;
  28. };
  29. template< int I > struct arg
  30. {
  31. BOOST_CONSTEXPR arg()
  32. {
  33. }
  34. template< class T > BOOST_CONSTEXPR arg( T const & /* t */, typename _arg_eq< I == is_placeholder<T>::value >::type * = 0 )
  35. {
  36. }
  37. };
  38. template< int I > BOOST_CONSTEXPR bool operator==( arg<I> const &, arg<I> const & )
  39. {
  40. return true;
  41. }
  42. #if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
  43. template< int I > struct is_placeholder< arg<I> >
  44. {
  45. enum _vt { value = I };
  46. };
  47. template< int I > struct is_placeholder< arg<I> (*) () >
  48. {
  49. enum _vt { value = I };
  50. };
  51. #endif
  52. } // namespace boost
  53. #endif // #ifndef BOOST_BIND_ARG_HPP_INCLUDED