2 // Copyright 2018 Mateusz Loskot <mateusz at loskot dot net>
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
8 #ifndef BOOST_GIL_USE_CONCEPT_CHECK
9 #error Compile with BOOST_GIL_USE_CONCEPT_CHECK defined
11 #include <boost/gil/concepts.hpp>
12 #include <boost/gil/point.hpp>
14 #include <type_traits>
16 namespace gil = boost::gil;
19 template <typename Point>
22 static_assert(Point::num_dimensions == 2U, "point is not 2D");
24 using value_t = typename Point::value_type;
25 using coord_t = typename Point::template axis<0>::coord_t;
26 static_assert(std::is_same<value_t, coord_t>::value,
27 "point and axis type mismatch");
32 boost::function_requires<gil::PointNDConcept<gil::point<int>>>();
33 boost::function_requires<gil::PointNDConcept<gil::point_t>>();
35 boost::function_requires<gil::Point2DConcept<gil::point<int>>>();
36 boost::function_requires<gil::Point2DConcept<gil::point_t>>();
38 test_members<gil::point<int>>();
39 test_members<gil::point_t>();
41 // NOTE: point2 is deprecated, available for backward compatibility
42 boost::function_requires<gil::PointNDConcept<gil::point2<int>>>();
43 boost::function_requires<gil::Point2DConcept<gil::point2<int>>>();
44 test_members<gil::point2<int>>();