not.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
  5. // This file was modified by Oracle on 2015, 2017.
  6. // Modifications copyright (c) 2015-2017, Oracle and/or its affiliates.
  7. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
  8. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  9. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  10. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  11. // Use, modification and distribution is subject to the Boost Software License,
  12. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt)
  14. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_NOT_HPP
  15. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_NOT_HPP
  16. namespace boost { namespace geometry
  17. {
  18. #ifndef DOXYGEN_NO_DETAIL
  19. namespace detail
  20. {
  21. /*!
  22. \brief Structure negating the result of specified policy
  23. \tparam Geometry1 \tparam_geometry
  24. \tparam Geometry2 \tparam_geometry
  25. \tparam Policy
  26. \param geometry1 \param_geometry
  27. \param geometry2 \param_geometry
  28. \return Negation of the result of the policy
  29. */
  30. template <typename Policy>
  31. struct not_
  32. {
  33. template <typename Geometry1, typename Geometry2>
  34. static inline bool apply(Geometry1 const& geometry1,
  35. Geometry2 const& geometry2)
  36. {
  37. return ! Policy::apply(geometry1, geometry2);
  38. }
  39. template <typename Geometry1, typename Geometry2, typename Strategy>
  40. static inline bool apply(Geometry1 const& geometry1,
  41. Geometry2 const& geometry2,
  42. Strategy const& strategy)
  43. {
  44. return ! Policy::apply(geometry1, geometry2, strategy);
  45. }
  46. };
  47. } // namespace detail
  48. #endif // DOXYGEN_NO_DETAIL
  49. }} // namespace boost::geometry
  50. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_NOT_HPP