class_concept_fail_expected.cpp 694 B

1234567891011121314151617181920212223242526272829303132
  1. // (C) Copyright Jeremy Siek, David Abrahams 2000-2006.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. //
  6. // Change Log:
  7. // 20 Jan 2001 - Added warning suppression (David Abrahams)
  8. #include <boost/concept_check.hpp>
  9. /*
  10. This file verifies that class_requires of the Boost Concept Checking
  11. Library catches errors when it is supposed to.
  12. */
  13. struct foo { };
  14. template <class T>
  15. class class_requires_test
  16. {
  17. BOOST_CONCEPT_ASSERT((boost::EqualityComparable<foo>));
  18. };
  19. int
  20. main()
  21. {
  22. class_requires_test<int> x;
  23. (void)x; // suppress unused variable warning
  24. return 0;
  25. }