function_requiring_a_point.hpp 1.0 KB

1234567891011121314151617181920212223242526272829
  1. // Boost.Geometry (aka GGL, Generic Geometry Library) Point concept unit tests
  2. //
  3. // Copyright (c) 2008-2016 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2007-2016 Barend Gehrels, Amsterdam, the Netherlands.
  5. // Copyright (c) 2016 Adam Wulkiewicz, Lodz, Poland.
  6. // Use, modification and distribution is subject to the Boost Software License,
  7. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. #ifndef GEOMETRY_TEST_POINT_CONCEPT_FUNCTION_REQUIRING_A_POINT_HPP
  10. #define GEOMETRY_TEST_POINT_CONCEPT_FUNCTION_REQUIRING_A_POINT_HPP
  11. #include <boost/geometry/geometries/concepts/point_concept.hpp>
  12. namespace bg = boost::geometry;
  13. namespace test
  14. {
  15. template <typename P, typename C>
  16. inline void function_requiring_a_point(P& p1, const C& p2)
  17. {
  18. BOOST_CONCEPT_ASSERT((bg::concepts::Point<P>));
  19. BOOST_CONCEPT_ASSERT((bg::concepts::ConstPoint<C>));
  20. bg::set<0>(p1, bg::get<0>(p2));
  21. }
  22. }
  23. #endif // GEOMETRY_TEST_POINT_CONCEPT_FUNCTION_REQUIRING_A_POINT_HPP