From: Simon Marchi Date: Tue, 16 Jan 2024 18:59:43 +0000 (-0500) Subject: cpp-common/bt2c: make some constructors of CStringView constexpr X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=26d1608e0ae2873fb8543bb8a2b6bf65f3567ecd cpp-common/bt2c: make some constructors of CStringView constexpr Change-Id: I56daad7dae1bc65183f016a1a9d2d6c529b3569d Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/11689 Tested-by: jenkins Reviewed-by: Philippe Proulx --- diff --git a/src/cpp-common/bt2c/c-string-view.hpp b/src/cpp-common/bt2c/c-string-view.hpp index fb1b3a65..a7b54e70 100644 --- a/src/cpp-common/bt2c/c-string-view.hpp +++ b/src/cpp-common/bt2c/c-string-view.hpp @@ -31,14 +31,14 @@ public: * * Intentionally not explicit. */ - CStringView() noexcept = default; + constexpr CStringView() noexcept = default; /* * Builds a view of the C string `str` (may be `nullptr`). * * Intentionally not explicit. */ - CStringView(const char * const str) noexcept : _mStr {str} + constexpr CStringView(const char * const str) noexcept : _mStr {str} { }