]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Let the delegated constructor deal with the case of empty arrays. 16114/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 10 Oct 2023 16:32:33 +0000 (10:32 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 10 Oct 2023 16:32:33 +0000 (10:32 -0600)
include/deal.II/base/array_view.h

index d158f86a7fe46376a6c6687b462b34841d2bba2f..03f2e5146a230b869de21d96afb520129f88172f 100644 (file)
@@ -563,8 +563,7 @@ inline ArrayView<ElementType, MemorySpaceType>::ArrayView(
   const std::initializer_list<std::remove_cv_t<value_type>> &initializer)
   DEAL_II_CXX20_REQUIRES(std::is_const_v<ElementType>)
   : // use delegating constructor
-  ArrayView((initializer.size() > 0 ? initializer.begin() : nullptr),
-            initializer.size())
+  ArrayView(initializer.begin(), initializer.size())
 {}
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.