concept_check.hpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 "-Wconversion"
  14. #pragma clang diagnostic ignored "-Wfloat-equal"
  15. #pragma clang diagnostic ignored "-Wuninitialized"
  16. #endif
  17. #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
  18. #pragma GCC diagnostic push
  19. #pragma GCC diagnostic ignored "-Wconversion"
  20. #pragma GCC diagnostic ignored "-Wfloat-equal"
  21. #pragma GCC diagnostic ignored "-Wuninitialized"
  22. #endif
  23. #include <boost/concept_check.hpp>
  24. #if defined(BOOST_CLANG)
  25. #pragma clang diagnostic pop
  26. #endif
  27. #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
  28. #pragma GCC diagnostic pop
  29. #endif
  30. // TODO: Document BOOST_GIL_USE_CONCEPT_CHECK here
  31. namespace boost { namespace gil {
  32. // TODO: What is GIL_CLASS_REQUIRE for; Why not use BOOST_CLASS_REQUIRE?
  33. // TODO: What is gil_function_requires for; Why not function_requires?
  34. #ifdef BOOST_GIL_USE_CONCEPT_CHECK
  35. #define GIL_CLASS_REQUIRE(type_var, ns, concept) \
  36. BOOST_CLASS_REQUIRE(type_var, ns, concept);
  37. template <typename Concept>
  38. void gil_function_requires() { function_requires<Concept>(); }
  39. #else
  40. #define GIL_CLASS_REQUIRE(type_var, ns, concept)
  41. template <typename C>
  42. void gil_function_requires() {}
  43. #endif
  44. }} // namespace boost::gil:
  45. #endif