concept_check.hpp 1.6 KB

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