cpp-common/bt2: do not use `bpstd::string_view`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 13 Nov 2023 20:43:31 +0000 (15:43 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 14 Dec 2023 15:57:04 +0000 (10:57 -0500)
commit5cc5088c99cfef4584388872e51a92b8f2268ed3
treea5044415b9935a3473c79c9fabc51563d1447c20
parent9f7aea4d4d9fc4e046b40fc00786f8b114a9cb15
cpp-common/bt2: do not use `bpstd::string_view`

Using `bpstd::string_view` in those contexts was a mistake: building a
`bpstd::string_view` object from a null-terminated string requires to
get its length (think strlen()), and an optional string view requires to
return `nonstd::optional<bpstd::string_view>` which means checking the
library pointer first.

All this means it's not a zero cost, and zero cost is what those C++
bindings aim to be.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ib51fb9e326c4b4c450a381631b9db69f6cd0530b
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11370
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/field.hpp
src/cpp-common/bt2/trace-ir.hpp
src/cpp-common/bt2/value.hpp
This page took 0.024825 seconds and 4 git commands to generate.