Imported Upstream version 1.71.0
[platform/upstream/boost.git] / libs / gil / test / core / image_view / derived_view_type.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.hpp>
9
10 #include <type_traits>
11
12 namespace gil = boost::gil;
13
14 int main()
15 {
16
17     static_assert(std::is_same
18         <
19             gil::derived_view_type<gil::cmyk8c_planar_step_view_t>::type,
20             gil::cmyk8c_planar_step_view_t
21         >::value, "derived_view_type should be cmyk8c_planar_step_view_t");
22
23     static_assert(std::is_same
24         <
25             gil::derived_view_type
26             <
27                 gil::cmyk8c_planar_step_view_t, std::uint16_t, gil::rgb_layout_t
28             >::type,
29             gil::rgb16c_planar_step_view_t
30         >::value, "derived_view_type should be rgb16c_planar_step_view_t");
31
32     static_assert(std::is_same
33         <
34             gil::derived_view_type
35             <
36                 gil::cmyk8c_planar_step_view_t,
37                 boost::use_default,
38                 gil::rgb_layout_t,
39                 std::false_type,
40                 boost::use_default,
41                 std::false_type
42             >::type,
43             gil::rgb8c_step_view_t
44         >::value, "derived_view_type should be rgb8c_step_view_t");
45 }