]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Ensure that the std::optional in Lazy is not yet used. 16306/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 29 Nov 2023 20:34:06 +0000 (13:34 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 29 Nov 2023 20:34:06 +0000 (13:34 -0700)
include/deal.II/base/lazy.h

index abee357210067b199e248889285a734dce856e20..3e8715916d174c64ebf37b7b9f1dd25455ce78e3 100644 (file)
@@ -379,6 +379,7 @@ inline DEAL_II_ALWAYS_INLINE
       //
       if (!object_is_initialized.load(std::memory_order_relaxed))
         {
+          Assert(object.has_value() == false, ExcInternalError());
           object.emplace(std::move(creator()));
 
           //

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.