From: Simon Marchi Date: Thu, 29 Feb 2024 19:58:04 +0000 (-0500) Subject: cpp-common/bt2: add static_assert in `CommonClockClass::uuid(const std::uint8_t *)` X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=77160ac2dcf3bcc30b079af4baeffee604e11037 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 --- 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; }