// // 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 #include #include #include namespace gil = boost::gil; using namespace boost::mp11; template struct assert_compatible { template void operator()(CompatiblePixel&&) { using result_t = typename gil::pixels_are_compatible::type; static_assert(result_t::value, "pixels should be compatible"); // TODO: Refine after MPL -> MP11 switch static_assert( std::is_same::value, "pixels_are_compatible result type should be std::true_type"); static_assert( !std::is_same::value, "pixels_are_compatible result type should no be std::false_type"); } }; template struct assert_not_compatible { template void operator()(NotCompatiblePixel&&) { static_assert( !gil::pixels_are_compatible::value, "pixels should not be compatible"); } }; template void test_compatible() { mp_for_each(assert_compatible()); } template void test_not_compatible() { mp_for_each(assert_not_compatible()); } int main() { test_compatible>(); test_compatible>(); test_not_compatible>(); test_compatible>(); test_compatible>(); test_not_compatible>(); test_compatible>(); test_compatible>(); test_not_compatible>(); test_compatible>(); test_not_compatible>(); test_compatible>(); test_compatible>(); test_not_compatible>(); test_compatible>(); }