Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / gil / test / core / color / color_spaces_are_compatible.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 #include <boost/gil/color_base.hpp>
9 #include <boost/gil/concepts.hpp>
10 #include <boost/gil/device_n.hpp>
11 #include <boost/gil/gray.hpp>
12 #include <boost/gil/rgb.hpp>
13 #include <boost/gil/rgba.hpp>
14 #include <boost/gil/cmyk.hpp>
15 #include <boost/gil/typedefs.hpp>
16
17 #include <boost/mp11.hpp>
18
19 #include <type_traits>
20
21 namespace gil = boost::gil;
22 using namespace boost::mp11;
23
24 template <typename T>
25 using test_self_compatible = gil::color_spaces_are_compatible<T, T>;
26
27 int main()
28 {
29     using color_spaces = mp_list
30     <
31         gil::devicen_t<2>,
32         gil::devicen_t<3>,
33         gil::devicen_t<4>,
34         gil::devicen_t<5>,
35         gil::gray_t,
36         gil::cmyk_t,
37         gil::rgb_t,
38         gil::rgba_t
39     >;
40
41     static_assert(std::is_same
42         <
43             mp_all_of<color_spaces, test_self_compatible>,
44             std::true_type
45         >::value,
46         "color_spaces_are_compatible should yield true for the same types");
47 }