Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / gil / test / core / color_base / concepts.cpp
1 //
2 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
3 //
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
7 //
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
14 #endif
15 #include <boost/gil/concepts.hpp>
16 #include <boost/gil/color_base.hpp>
17 #include <boost/gil/typedefs.hpp>
18
19 #include <boost/concept_check.hpp>
20
21 namespace gil = boost::gil;
22 using boost::function_requires;
23
24 int main()
25 {
26     function_requires<gil::ColorBaseConcept
27         <
28             gil::detail::homogeneous_color_base<std::uint8_t, gil::gray_layout_t, 1>
29         >>();
30
31     function_requires<gil::HomogeneousColorBaseConcept
32         <
33             gil::detail::homogeneous_color_base<std::uint8_t, gil::gray_layout_t, 1>
34         >>();
35
36     function_requires<gil::HomogeneousColorBaseValueConcept
37         <
38             gil::detail::homogeneous_color_base<std::uint8_t, gil::gray_layout_t, 1>
39         >>();
40
41     // FIXME: https://github.com/boostorg/gil/issues/271
42     //function_requires
43     //<
44     //    gil::ColorBaseConcept
45     //    <
46     //        gil::detail::homogeneous_color_base<std::uint8_t, gil::rgb_layout_t, 3>
47     //    >
48     //>();
49
50     function_requires<gil::ColorBaseConcept<gil::gray8_pixel_t>>();
51     function_requires<gil::ColorBaseConcept<gil::rgb8_pixel_t>>();
52     function_requires<gil::ColorBaseConcept<gil::bgr8_pixel_t>>();
53
54 }