info_tuple.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef UUID_63EE924290FB11DC87BB856555D89593
  5. #define UUID_63EE924290FB11DC87BB856555D89593
  6. #include <boost/exception/info.hpp>
  7. #include <boost/tuple/tuple.hpp>
  8. #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  9. #pragma GCC system_header
  10. #endif
  11. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  12. #pragma warning(push,1)
  13. #endif
  14. namespace
  15. boost
  16. {
  17. template <
  18. class E >
  19. inline
  20. E const &
  21. operator<<(
  22. E const & x,
  23. tuple< > const & v )
  24. {
  25. return x;
  26. }
  27. template <
  28. class E,
  29. class Tag1,class T1 >
  30. inline
  31. E const &
  32. operator<<(
  33. E const & x,
  34. tuple<
  35. error_info<Tag1,T1> > const & v )
  36. {
  37. return x << v.template get<0>();
  38. }
  39. template <
  40. class E,
  41. class Tag1,class T1,
  42. class Tag2,class T2 >
  43. inline
  44. E const &
  45. operator<<(
  46. E const & x,
  47. tuple<
  48. error_info<Tag1,T1>,
  49. error_info<Tag2,T2> > const & v )
  50. {
  51. return x << v.template get<0>() << v.template get<1>();
  52. }
  53. template <
  54. class E,
  55. class Tag1,class T1,
  56. class Tag2,class T2,
  57. class Tag3,class T3 >
  58. inline
  59. E const &
  60. operator<<(
  61. E const & x,
  62. tuple<
  63. error_info<Tag1,T1>,
  64. error_info<Tag2,T2>,
  65. error_info<Tag3,T3> > const & v )
  66. {
  67. return x << v.template get<0>() << v.template get<1>() << v.template get<2>();
  68. }
  69. template <
  70. class E,
  71. class Tag1,class T1,
  72. class Tag2,class T2,
  73. class Tag3,class T3,
  74. class Tag4,class T4 >
  75. inline
  76. E const &
  77. operator<<(
  78. E const & x,
  79. tuple<
  80. error_info<Tag1,T1>,
  81. error_info<Tag2,T2>,
  82. error_info<Tag3,T3>,
  83. error_info<Tag4,T4> > const & v )
  84. {
  85. return x << v.template get<0>() << v.template get<1>() << v.template get<2>() << v.template get<3>();
  86. }
  87. }
  88. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  89. #pragma warning(pop)
  90. #endif
  91. #endif