cpp-common: add `bt2s::span` 0.11.0 and other related symbols
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 31 Jan 2024 22:41:47 +0000 (17:41 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 5 Feb 2024 16:46:02 +0000 (11:46 -0500)
commit30586bf0137ab0f20a04b8b1eed90d42effbe479
tree0d0a19f8aa4c156cf23f0a5e745409e98e225b40
parentfa447211d316bba4342402d754d71baba9fad671
cpp-common: add `bt2s::span` 0.11.0 and other related symbols

This patch adds `bt2s::span` which wraps `nonstd::span`, that is,
span lite [1], a project written by the author also who wrote our
`bt2s::optional` implementation, therefore I trust him.

span lite is an implementation of `std::span` [2] for C++98 and up:

> The class template `span` describes an object that can refer to a
> contiguous sequence of objects with the first element of the sequence
> at position zero.

This will be useful to pass some data block as a single parameter
without copying the viewed data (in other words, a pointer and a length
with some sugar such as operator[]() and the like).

[1]: https://github.com/martinmoene/span-lite
[2]: https://en.cppreference.com/w/cpp/container/span

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ife35b4be41536fec15aef9d6603a80746c3e8727
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11728
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/Makefile.am
src/cpp-common/bt2s/span.hpp [new file with mode: 0644]
src/cpp-common/vendor/span-lite/span.hpp [new file with mode: 0644]
src/cpp-common/vendor/span-lite/span.hpp.license [new file with mode: 0644]
This page took 0.02593 seconds and 4 git commands to generate.