about summary refs log tree commit diff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-09-03T11·00+0200
committerEelco Dolstra <edolstra@gmail.com>2019-09-03T11·45+0200
commitf186000367978fbe590343f47951232f42a30bec (patch)
tree4793e33f10f3d9b1daf6d7a99330b8452c7cbb6a /src/libutil/util.hh
parent7348653ff4fc4e9b2dc24943aabdb57179b1c75a (diff)
Add some noexcepts
This is to assert that callback functions should never throw (since
the context in which they're called may not be able to handle the
exception).
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 686e81d3f893..07c3d28ff2d6 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -460,7 +460,7 @@ public:
         if (prev) done.test_and_set();
     }
 
-    void operator()(T && t)
+    void operator()(T && t) noexcept
     {
         auto prev = done.test_and_set();
         assert(!prev);
@@ -469,7 +469,7 @@ public:
         fun(promise.get_future());
     }
 
-    void rethrow(const std::exception_ptr & exc = std::current_exception())
+    void rethrow(const std::exception_ptr & exc = std::current_exception()) noexcept
     {
         auto prev = done.test_and_set();
         assert(!prev);