derived_view_type.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #include <type_traits>
  10. namespace gil = boost::gil;
  11. int main()
  12. {
  13. static_assert(std::is_same
  14. <
  15. gil::derived_view_type<gil::cmyk8c_planar_step_view_t>::type,
  16. gil::cmyk8c_planar_step_view_t
  17. >::value, "derived_view_type should be cmyk8c_planar_step_view_t");
  18. static_assert(std::is_same
  19. <
  20. gil::derived_view_type
  21. <
  22. gil::cmyk8c_planar_step_view_t, std::uint16_t, gil::rgb_layout_t
  23. >::type,
  24. gil::rgb16c_planar_step_view_t
  25. >::value, "derived_view_type should be rgb16c_planar_step_view_t");
  26. static_assert(std::is_same
  27. <
  28. gil::derived_view_type
  29. <
  30. gil::cmyk8c_planar_step_view_t,
  31. boost::use_default,
  32. gil::rgb_layout_t,
  33. std::false_type,
  34. boost::use_default,
  35. std::false_type
  36. >::type,
  37. gil::rgb8c_step_view_t
  38. >::value, "derived_view_type should be rgb8c_step_view_t");
  39. }