concept_check.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // Copyright 2005-2007 Adobe Systems Incorporated
  3. //
  4. // Distributed under the Boost Software License, Version 1.0
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. //
  8. #ifndef BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
  9. #define BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
  10. #include <boost/config.hpp>
  11. #if defined(BOOST_CLANG)
  12. #pragma clang diagnostic push
  13. #pragma clang diagnostic ignored "-Wfloat-equal"
  14. #pragma clang diagnostic ignored "-Wuninitialized"
  15. #endif
  16. #if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
  17. #pragma GCC diagnostic push
  18. #pragma GCC diagnostic ignored "-Wfloat-equal"
  19. #pragma GCC diagnostic ignored "-Wuninitialized"
  20. #endif
  21. #include <boost/concept_check.hpp>
  22. #if defined(BOOST_CLANG)
  23. #pragma clang diagnostic pop
  24. #endif
  25. #if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
  26. #pragma GCC diagnostic pop
  27. #endif
  28. // TODO: Document BOOST_GIL_USE_CONCEPT_CHECK here
  29. namespace boost { namespace gil {
  30. // TODO: What is GIL_CLASS_REQUIRE for; Why not use BOOST_CLASS_REQUIRE?
  31. // TODO: What is gil_function_requires for; Why not function_requires?
  32. #ifdef BOOST_GIL_USE_CONCEPT_CHECK
  33. #define GIL_CLASS_REQUIRE(type_var, ns, concept) \
  34. BOOST_CLASS_REQUIRE(type_var, ns, concept);
  35. template <typename Concept>
  36. void gil_function_requires() { function_requires<Concept>(); }
  37. #else
  38. #define GIL_CLASS_REQUIRE(type_var, ns, concept)
  39. template <typename C>
  40. void gil_function_requires() {}
  41. #endif
  42. }} // namespace boost::gil:
  43. #endif