info_tuple.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. namespace
  9. boost
  10. {
  11. template <
  12. class E,
  13. class Tag1,class T1,
  14. class Tag2,class T2 >
  15. inline
  16. E const &
  17. operator<<(
  18. E const & x,
  19. tuple<
  20. error_info<Tag1,T1>,
  21. error_info<Tag2,T2> > const & v )
  22. {
  23. return x << v.template get<0>() << v.template get<1>();
  24. }
  25. template <
  26. class E,
  27. class Tag1,class T1,
  28. class Tag2,class T2,
  29. class Tag3,class T3 >
  30. inline
  31. E const &
  32. operator<<(
  33. E const & x,
  34. tuple<
  35. error_info<Tag1,T1>,
  36. error_info<Tag2,T2>,
  37. error_info<Tag3,T3> > const & v )
  38. {
  39. return x << v.template get<0>() << v.template get<1>() << v.template get<2>();
  40. }
  41. template <
  42. class E,
  43. class Tag1,class T1,
  44. class Tag2,class T2,
  45. class Tag3,class T3,
  46. class Tag4,class T4 >
  47. inline
  48. E const &
  49. operator<<(
  50. E const & x,
  51. tuple<
  52. error_info<Tag1,T1>,
  53. error_info<Tag2,T2>,
  54. error_info<Tag3,T3>,
  55. error_info<Tag4,T4> > const & v )
  56. {
  57. return x << v.template get<0>() << v.template get<1>() << v.template get<2>() << v.template get<3>();
  58. }
  59. }
  60. #endif