// // Copyright 2019 Mateusz Loskot // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // #include #include namespace gil = boost::gil; struct Interleaved : std::false_type {}; struct Planar : std::true_type {}; struct NotStepX : std::false_type {}; struct StepX : std::true_type {}; struct Immutable : std::false_type {}; struct Mutable : std::true_type {}; template void test() { static_assert(std::is_same < typename gil::view_type_from_pixel < Pixel, IsPlanar::value, IsStepX::value, IsMutable::value >::type, ResultView >::value, "view_type_from_pixel yields unexpected view"); } template void test_not() { static_assert(!std::is_same < typename gil::view_type_from_pixel < Pixel, IsPlanar::value, IsStepX::value, IsMutable::value >::type, ResultView >::value, "view_type_from_pixel yields unexpected view"); } int main() { test(); test(); // Immutable view from mutable pixel type is allowed test(); // Mutable view from immutable pixel type not allowed test_not(); test(); test_not(); test(); test_not(); test_not(); test_not(); test_not(); test(); test(); test(); test(); test_not(); test_not(); test(); test(); test(); test(); test(); test(); test(); test(); test_not(); test(); test(); test(); test(); test_not(); test_not(); test(); test(); test(); test(); test_not(); test_not(); test_not(); test_not(); test(); test(); test(); test(); test(); test(); test(); test(); test_not(); test(); test(); test(); test(); }