diff --git a/include/xtensor/containers/xcontainer.hpp b/include/xtensor/containers/xcontainer.hpp index 70ebaa798..a7fbdf743 100644 --- a/include/xtensor/containers/xcontainer.hpp +++ b/include/xtensor/containers/xcontainer.hpp @@ -422,7 +422,7 @@ namespace xt template inline void xcontainer::fill(const T& value) { - if (contiguous_layout) + if (contiguous_layout || this->is_contiguous()) { std::fill(this->linear_begin(), this->linear_end(), value); }