changeset 945:8e1a8c85a7d6

Seems this cannot be made noexcept due standards not requireing support for it.
author John Schneiderman <JohnMS@member.fsf.org>
date Mon, 20 Nov 2023 17:08:13 +0100
parents e005329761af
children a5c5296ca17f
files src/foundation/external/foundation/ScopeExecutor.cpp src/foundation/external/foundation/ScopeExecutor.h
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/foundation/external/foundation/ScopeExecutor.cpp	Tue Nov 14 18:17:29 2023 +0100
+++ b/src/foundation/external/foundation/ScopeExecutor.cpp	Mon Nov 20 17:08:13 2023 +0100
@@ -27,7 +27,7 @@
 using std::move;
 
 
-ScopeExecutor::ScopeExecutor(function<void() /*noexcept*/> execute) :
+ScopeExecutor::ScopeExecutor(function<void()> execute) :
 	execute_{move(execute)}
 {
 	assert(this->execute_ != nullptr && "The supplied execute function cannot be null");
--- a/src/foundation/external/foundation/ScopeExecutor.h	Tue Nov 14 18:17:29 2023 +0100
+++ b/src/foundation/external/foundation/ScopeExecutor.h	Mon Nov 20 17:08:13 2023 +0100
@@ -35,15 +35,16 @@
  */
 class DRN_FOUNDATION_EXPORT ScopeExecutor
 {
-	std::function<void() /*noexcept*/> execute_; // TODO: Fix GCC error when using C++20.
+	std::function<void()> execute_;
 
 public:
 	/**
 	 * @brief Full initialisation constructor.
 	 *
-	 * @param execute The function that should be executed upon object destruction.
+	 * @param execute The function that should be executed upon object destruction. The executable
+	 * function must not throw.
 	 */
-	ScopeExecutor(std::function<void() /*noexcept*/> execute);
+	ScopeExecutor(std::function<void()> execute);
 	/**
 	 * @brief Executes the supplied function.
 	 */