blank_test.cpp 825 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2018 Daniel James.
  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/blank.hpp>
  5. #include <boost/static_assert.hpp>
  6. #include <cassert>
  7. #if !defined(BOOST_NO_IOSTREAM)
  8. #include <sstream>
  9. #endif
  10. int main() {
  11. BOOST_STATIC_ASSERT((boost::is_pod<boost::blank>::value));
  12. BOOST_STATIC_ASSERT((boost::is_empty<boost::blank>::value));
  13. BOOST_STATIC_ASSERT((boost::is_stateless<boost::blank>::value));
  14. boost::blank b1,b2;
  15. assert(b1 == b2);
  16. assert(b1 <= b2);
  17. assert(b1 >= b2);
  18. assert(!(b1 != b2));
  19. assert(!(b1 < b2));
  20. assert(!(b1 > b2));
  21. #if !defined(BOOST_NO_IOSTREAM)
  22. std::stringstream s;
  23. s << "(" << b1 << ")";
  24. assert(s.str() == "()");
  25. #endif
  26. }