Skip to content

Commit

Permalink
Fix any_image_view::const_t
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebionne committed Oct 21, 2020
1 parent f374a67 commit ccac44f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/boost/gil/extension/dynamic_image/any_image_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ struct dynamic_xy_step_transposed_type;
namespace detail {

template <typename View>
struct get_const_t { using type = typename View::const_t; };
using get_const_t = typename View::const_t;

template <typename Views>
struct views_get_const_t : mp11::mp_transform<get_const_t, Views> {};
using views_get_const_t = mp11::mp_transform<get_const_t, Views>;

// works for both image_view and image
struct any_type_get_num_channels
Expand Down
1 change: 1 addition & 0 deletions test/extension/dynamic_image/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
message(STATUS "Boost.GIL: Configuring tests in test/extension/dynamic_image")
foreach(_name
any_image
any_image_view
subimage_view)
set(_test t_ext_dynamic_image_${_name})
set(_target test_ext_dynamic_image_${_name})
Expand Down
27 changes: 27 additions & 0 deletions test/extension/dynamic_image/any_image_view.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// Copyright 2020 Samuel Debionne
//
// 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 <type_traits>

#include <boost/gil.hpp>
#include <boost/gil/extension/dynamic_image/any_image_view.hpp>

#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>

#include "test_fixture.hpp"
#include "core/image/test_fixture.hpp"

namespace gil = boost::gil;
namespace fixture = boost::gil::test::fixture;

int main()
{
BOOST_TEST_TRAIT_SAME(gil::any_image_view<gil::gray8_view_t>::const_t, gil::any_image_view<gil::gray8c_view_t>);

return ::boost::report_errors();
}

0 comments on commit ccac44f

Please sign in to comment.