info_tuple.hpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 BOOST_EXCEPTION_63EE924290FB11DC87BB856555D89593
  5. #define BOOST_EXCEPTION_63EE924290FB11DC87BB856555D89593
  6. #include <boost/exception/info.hpp>
  7. #include <boost/tuple/tuple.hpp>
  8. #ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
  9. #if __GNUC__*100+__GNUC_MINOR__>301
  10. #pragma GCC system_header
  11. #endif
  12. #ifdef __clang__
  13. #pragma clang system_header
  14. #endif
  15. #ifdef _MSC_VER
  16. #pragma warning(push,1)
  17. #endif
  18. #endif
  19. namespace
  20. boost
  21. {
  22. template <
  23. class E >
  24. inline
  25. E const &
  26. operator<<(
  27. E const & x,
  28. tuple< > const & v )
  29. {
  30. return x;
  31. }
  32. template <
  33. class E,
  34. class Tag1,class T1 >
  35. inline
  36. E const &
  37. operator<<(
  38. E const & x,
  39. tuple<
  40. error_info<Tag1,T1> > const & v )
  41. {
  42. return x << v.template get<0>();
  43. }
  44. template <
  45. class E,
  46. class Tag1,class T1,
  47. class Tag2,class T2 >
  48. inline
  49. E const &
  50. operator<<(
  51. E const & x,
  52. tuple<
  53. error_info<Tag1,T1>,
  54. error_info<Tag2,T2> > const & v )
  55. {
  56. return x << v.template get<0>() << v.template get<1>();
  57. }
  58. template <
  59. class E,
  60. class Tag1,class T1,
  61. class Tag2,class T2,
  62. class Tag3,class T3 >
  63. inline
  64. E const &
  65. operator<<(
  66. E const & x,
  67. tuple<
  68. error_info<Tag1,T1>,
  69. error_info<Tag2,T2>,
  70. error_info<Tag3,T3> > const & v )
  71. {
  72. return x << v.template get<0>() << v.template get<1>() << v.template get<2>();
  73. }
  74. template <
  75. class E,
  76. class Tag1,class T1,
  77. class Tag2,class T2,
  78. class Tag3,class T3,
  79. class Tag4,class T4 >
  80. inline
  81. E const &
  82. operator<<(
  83. E const & x,
  84. tuple<
  85. error_info<Tag1,T1>,
  86. error_info<Tag2,T2>,
  87. error_info<Tag3,T3>,
  88. error_info<Tag4,T4> > const & v )
  89. {
  90. return x << v.template get<0>() << v.template get<1>() << v.template get<2>() << v.template get<3>();
  91. }
  92. }
  93. #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  94. #pragma warning(pop)
  95. #endif
  96. #endif