From e0194a36b382005b260f044226a84542a27e9e6d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 7 May 2023 11:15:09 -0600 Subject: [PATCH] Mark special functions as =deleted. --- include/deal.II/base/scope_exit.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/deal.II/base/scope_exit.h b/include/deal.II/base/scope_exit.h index 202fb28529..b7fb2d014b 100644 --- a/include/deal.II/base/scope_exit.h +++ b/include/deal.II/base/scope_exit.h @@ -140,11 +140,24 @@ public: */ ScopeExit(const std::function &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. -- 2.39.5