failure_policy.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2015, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
  4. // Licensed under the Boost Software License version 1.0.
  5. // http://www.boost.org/users/license.html
  6. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_FAILURE_POLICY_HPP
  7. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_FAILURE_POLICY_HPP
  8. #include <boost/geometry/algorithms/validity_failure_type.hpp>
  9. namespace boost { namespace geometry
  10. {
  11. #ifndef DOXYGEN_NO_DETAIL
  12. namespace detail { namespace is_simple
  13. {
  14. struct simplicity_failure_policy
  15. {
  16. template <validity_failure_type Failure>
  17. static inline bool apply()
  18. {
  19. return Failure == no_failure;
  20. }
  21. template <validity_failure_type Failure, typename Data>
  22. static inline bool apply(Data const&)
  23. {
  24. return apply<Failure>();
  25. }
  26. template <validity_failure_type Failure, typename Data1, typename Data2>
  27. static inline bool apply(Data1 const&, Data2 const&)
  28. {
  29. return apply<Failure>();
  30. }
  31. };
  32. }} // namespace detail::is_simple
  33. #endif // DOXYGEN_NO_DETAIL
  34. }} // namespace boost::geometry
  35. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_FAILURE_POLICY_HPP