Skip to content

Commit

Permalink
change the method of dealing with assertion errors mentioned in boost…
Browse files Browse the repository at this point in the history
  • Loading branch information
meshtag committed Aug 20, 2021
1 parent 723499d commit 9bff47a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/boost/gil/extension/numeric/kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ class kernel_2d_adaptor : public Core
explicit kernel_2d_adaptor(std::size_t center_y, std::size_t center_x)
: center_(center_x, center_y)
{
Core c;
BOOST_ASSERT(center_.y < c.size() && center_.x < c.size());
// std::cout << this->size() << " " << center_.y << " " << center_.x << "\n";
// BOOST_ASSERT(center_.y < this->size() && center_.x < this->size());
BOOST_ASSERT(center_.y < this->size() && center_.x < this->size());
}

kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x)
Expand Down Expand Up @@ -246,7 +243,7 @@ class kernel_2d_adaptor : public Core

std::size_t size() const
{
return square_size;
return square_size ? square_size : std::sqrt((Core ()).size());
}

typename Core::value_type at(std::size_t x, std::size_t y) const
Expand Down

0 comments on commit 9bff47a

Please sign in to comment.