From 77160ac2dcf3bcc30b079af4baeffee604e11037 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 29 Feb 2024 14:58:04 -0500 Subject: [PATCH] cpp-common/bt2: add static_assert in `CommonClockClass::uuid(const std::uint8_t *)` Change-Id: I66399af51ab21c52e8fbc61cc61cae1b94f1e2e7 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/11956 Tested-by: jenkins Reviewed-by: Philippe Proulx --- src/cpp-common/bt2/clock-class.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cpp-common/bt2/clock-class.hpp b/src/cpp-common/bt2/clock-class.hpp index ad033b0e..5b80890d 100644 --- a/src/cpp-common/bt2/clock-class.hpp +++ b/src/cpp-common/bt2/clock-class.hpp @@ -215,6 +215,8 @@ public: CommonClockClass uuid(const bt2c::UuidView uuid) const noexcept { + static_assert(!std::is_const::value, "Not available with `bt2::ConstClockClass`."); + bt_clock_class_set_uuid(this->libObjPtr(), uuid.data()); return *this; } -- 2.34.1