]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Mark special functions as =deleted.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 7 May 2023 17:15:09 +0000 (11:15 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sun, 7 May 2023 17:15:09 +0000 (11:15 -0600)
include/deal.II/base/scope_exit.h

index 202fb28529b9a8b60b071992bd9b02a5c00768c6..b7fb2d014b27e1f549b43bcade82a129768f6365 100644 (file)
@@ -140,11 +140,24 @@ public:
    */
   ScopeExit(const std::function<void()> &exit_function);
 
+  /**
+   * Copy constructor. These kinds of objects cannot be copied, so the
+   * constructor is deleted.
+   */
+  ScopeExit(const ScopeExit &) = delete;
+
   /**
    * Destructor. Execute the stored action.
    */
   ~ScopeExit();
 
+  /**
+   * Copy operator. These kinds of objects cannot be copied, so the
+   * operator is deleted.
+   */
+  ScopeExit &
+  operator=(const ScopeExit &) = delete;
+
 private:
   /**
    * A copy of the function to be executed.

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.