projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
cpp-common/bt2c: make CStringView convertible from std::string
[babeltrace.git]
/
src
/
cpp-common
/
bt2c
/
c-string-view.hpp
diff --git
a/src/cpp-common/bt2c/c-string-view.hpp
b/src/cpp-common/bt2c/c-string-view.hpp
index c1c8bf389c8bd50233bc56ae54bd602a5aceda5c..fb1b3a658aeb87fab893da56d52c380780f7d25f 100644
(file)
--- a/
src/cpp-common/bt2c/c-string-view.hpp
+++ b/
src/cpp-common/bt2c/c-string-view.hpp
@@
-42,6
+42,15
@@
public:
{
}
+ /*
+ * Builds a view of the string `str`.
+ *
+ * Intentionally not explicit.
+ */
+ CStringView(const std::string& str) noexcept : _mStr {str.c_str()}
+ {
+ }
+
/*
* Makes this view view the C string `str` (may be `nullptr`).
*
This page took
0.022635 seconds
and
4
git commands to generate.