From: Wolfgang Bangerth Date: Thu, 8 Dec 2016 04:29:17 +0000 (-0700) Subject: Allow copying of ArrayViews of length zero. X-Git-Tag: v8.5.0-rc1~339^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45ae1547c4a4780b27f47e55cfd53ab89b4c85ac;p=dealii.git Allow copying of ArrayViews of length zero. --- diff --git a/include/deal.II/base/array_view.h b/include/deal.II/base/array_view.h index c9d63d81cf..77c96b02b0 100644 --- a/include/deal.II/base/array_view.h +++ b/include/deal.II/base/array_view.h @@ -138,6 +138,8 @@ private: * The length of the array this object represents. */ const std::size_t n_elements; + + friend class ArrayView; }; @@ -160,8 +162,8 @@ template inline ArrayView::ArrayView(const ArrayView::type> &view) : - starting_element (&view[0]), - n_elements(view.size()) + starting_element (view.starting_element), + n_elements(view.n_elements) {}