diff --git a/include/xtensor/core/xaccessible.hpp b/include/xtensor/core/xaccessible.hpp index fa494e4ea..8ca55f8a4 100644 --- a/include/xtensor/core/xaccessible.hpp +++ b/include/xtensor/core/xaccessible.hpp @@ -36,7 +36,7 @@ namespace xt using const_reference = typename inner_types::const_reference; using size_type = typename inner_types::size_type; - size_type size() const noexcept; + size_type size() const noexcept(noexcept(derived_cast().shape())); size_type dimension() const noexcept; size_type shape(size_type index) const; @@ -138,7 +138,7 @@ namespace xt * Returns the size of the expression. */ template - inline auto xconst_accessible::size() const noexcept -> size_type + inline auto xconst_accessible::size() const noexcept(noexcept(derived_cast().shape())) -> size_type { return compute_size(derived_cast().shape()); }