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 // FIXME: Avoid Clang's flooding of non-disableable warnings like:
9 // "T does not declare any constructor to initialize its non-modifiable members"
10 // when compiling with concepts check enabled.
11 // See https://bugs.llvm.org/show_bug.cgi?id=41759
12 #if !defined(BOOST_GIL_USE_CONCEPT_CHECK) && !defined(__clang__)
13 #error Compile with BOOST_GIL_USE_CONCEPT_CHECK defined
15 #include <boost/gil/concepts.hpp>
16 #include <boost/gil/point.hpp>
18 #include <type_traits>
20 namespace gil = boost::gil;
23 template <typename Point>
26 static_assert(Point::num_dimensions == 2U, "point is not 2D");
28 using value_t = typename Point::value_type;
29 using coord_t = typename Point::template axis<0>::coord_t;
30 static_assert(std::is_same<value_t, coord_t>::value,
31 "point and axis type mismatch");
36 boost::function_requires<gil::PointNDConcept<gil::point<int>>>();
37 boost::function_requires<gil::PointNDConcept<gil::point_t>>();
39 boost::function_requires<gil::Point2DConcept<gil::point<int>>>();
40 boost::function_requires<gil::Point2DConcept<gil::point_t>>();
42 test_members<gil::point<int>>();
43 test_members<gil::point_t>();
45 // NOTE: point2 is deprecated, available for backward compatibility
46 boost::function_requires<gil::PointNDConcept<gil::point2<int>>>();
47 boost::function_requires<gil::Point2DConcept<gil::point2<int>>>();
48 test_members<gil::point2<int>>();