cpp-common/bt2: add `noexcept` to user attribute setters
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 3 Nov 2023 15:50:52 +0000 (11:50 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 14 Dec 2023 15:57:04 +0000 (10:57 -0500)
The bt_*_set_user_attributes() functions never fail (they only increment
the reference count of the received value), therefore the user attribute
setters never throw.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I5b9c05e6efd7b42965b9e075438b518df1a5da90
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11229
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/cpp-common/bt2/clock-class.hpp
src/cpp-common/bt2/field-class.hpp
src/cpp-common/bt2/trace-ir.hpp

index 398f8197396af7cd1290b852ccccb0f6e438e676..ce306eef9340c2be414a01fa85ae15f6b4f8f3eb 100644 (file)
@@ -245,7 +245,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT> userAttrs) const
+    void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
index d382db1d96118f40bb195cca9bc5823e180151cd..6682e5b52a07d9a239b358a2852594e881403e85 100644 (file)
@@ -421,7 +421,7 @@ public:
     asVariantWithSignedIntegerSelector() const noexcept;
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT> userAttrs) const
+    void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1039,7 +1039,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT> userAttrs) const
+    void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1913,7 +1913,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT> userAttrs) const
+    void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
index 4d058137f2c19eb7b145f8cfba13ef8ed8bef7a9..1026600e6b5089495b21e5f46a97a73f5db51267 100644 (file)
@@ -505,7 +505,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT> userAttrs) const
+    void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -819,7 +819,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT> userAttrs) const
+    void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1124,7 +1124,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT> userAttrs) const
+    void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1585,7 +1585,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT> userAttrs) const
+    void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -2021,7 +2021,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT> userAttrs) const
+    void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
This page took 0.027064 seconds and 4 git commands to generate.