Add `std::string_view` replacement (`bpstd::string_view`)
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 8 Dec 2020 14:48:44 +0000 (09:48 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 28 Jan 2022 16:22:26 +0000 (11:22 -0500)
commit225a4a847f6af80f4bb3583ff7c3c1d8b630aed2
treebb8c06b233102cfe4c309585541ced2df25d2872
parentdba8555979d55f701c773da6d07e9039df5fd19c
Add `std::string_view` replacement (`bpstd::string_view`)

This patch adds an `std::string_view` replacement, `bpstd::string_view`,
which comes from the MIT-licensed
<https://github.com/bitwizeshift/string_view-standalone> project.

Babeltrace 2 cannot use `std::string_view` as it's part of C++17,
whereas the project only requires C++11.

`bpstd::basic_string_view` and `bpstd::string_view` are meant to work
like C++17's `std::basic_string_view` and `std::string_view`.

In any Babeltrace 2 C++ file, include it like this:

    #include "cpp-common/string_view.hpp"

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Icd9329fb55959de92832f4715b02359e1ef44184
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4519
src/cpp-common/Makefile.am
src/cpp-common/string_view.hpp [new file with mode: 0644]
This page took 0.024024 seconds and 4 git commands to generate.