argument_fwd.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Boost.Range library
  2. //
  3. // Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and
  4. // distribution is subject to the Boost Software License, Version
  5. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // For more information, see http://www.boost.org/libs/range/
  9. //
  10. #ifndef BOOST_RANGE_ADAPTOR_ARGUMENT_FWD_HPP
  11. #define BOOST_RANGE_ADAPTOR_ARGUMENT_FWD_HPP
  12. #include <boost/config.hpp>
  13. #ifdef BOOST_MSVC
  14. #pragma warning(push)
  15. #pragma warning(disable : 4512) // assignment operator could not be generated
  16. #endif
  17. namespace boost
  18. {
  19. namespace range_detail
  20. {
  21. template< class T >
  22. struct holder
  23. {
  24. T val;
  25. holder( T t ) : val(t)
  26. { }
  27. };
  28. template< class T >
  29. struct holder2
  30. {
  31. T val1, val2;
  32. holder2( T t, T u ) : val1(t), val2(u)
  33. { }
  34. };
  35. template< template<class> class Holder >
  36. struct forwarder
  37. {
  38. template< class T >
  39. Holder<T> operator()( T t ) const
  40. {
  41. return Holder<T>(t);
  42. }
  43. };
  44. template< template<class> class Holder >
  45. struct forwarder2
  46. {
  47. template< class T >
  48. Holder<T> operator()( T t, T u ) const
  49. {
  50. return Holder<T>(t,u);
  51. }
  52. };
  53. template< template<class,class> class Holder >
  54. struct forwarder2TU
  55. {
  56. template< class T, class U >
  57. Holder<T, U> operator()( T t, U u ) const
  58. {
  59. return Holder<T, U>(t, u);
  60. }
  61. };
  62. }
  63. }
  64. #ifdef BOOST_MSVC
  65. #pragma warning(pop)
  66. #endif
  67. #endif