is_output_streamable_test.cpp 826 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #include <boost/exception/detail/is_output_streamable.hpp>
  5. namespace
  6. n1
  7. {
  8. class
  9. c1
  10. {
  11. };
  12. }
  13. namespace
  14. n2
  15. {
  16. class
  17. c2
  18. {
  19. };
  20. std::ostream &
  21. operator<<( std::ostream & s, c2 const & )
  22. {
  23. s << "c2";
  24. return s;
  25. }
  26. }
  27. template <bool Test>
  28. struct test;
  29. template <>
  30. struct
  31. test<true>
  32. {
  33. };
  34. int
  35. main()
  36. {
  37. test<!boost::is_output_streamable<n1::c1>::value>();
  38. test<boost::is_output_streamable<n2::c2>::value>();
  39. test<boost::is_output_streamable<int>::value>();
  40. return 0;
  41. }