cpp-common: add `bt2s::optional`, alias of `nonstd::optional`
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 11 Dec 2023 21:07:18 +0000 (16:07 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 14 Dec 2023 15:57:04 +0000 (10:57 -0500)
commitc022776a5704be758b90a56563d491861d29fa49
tree1f68e727757a08cbed9427783976b41ed3d388b7
parent80ab6559c42fadfbac0f131ba62a5984ffc945a0
cpp-common: add `bt2s::optional`, alias of `nonstd::optional`

In order to avoid having all sorts of external namespaces, make
`bt2s::optional` an alias of `nonstd::optional`, and make sure
everything in the project uses `bt2s::optional`.

Also add aliases for other STL types and functions of `<optional>`.

This will make it possible to easily change the implementation without
changing the code using it indirectly (only
`cpp-common/bt2s/optional.hpp` will change).

Move `cpp-common/optional.hpp` to
`cpp-common/vendor/optional-lite/optional.hpp` to make it clear it's an
external project.

Making everything under `cpp-common/vendor` an exception in
`tools/format-cpp.sh`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I2a1ea52c484c85fbf8d68631d40369efd969818a
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11391
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
13 files changed:
src/Makefile.am
src/cpp-common/bt2/clock-class.hpp
src/cpp-common/bt2/field-class.hpp
src/cpp-common/bt2/field.hpp
src/cpp-common/bt2/message-iterator.hpp
src/cpp-common/bt2/message.hpp
src/cpp-common/bt2/shared-object.hpp
src/cpp-common/bt2/trace-ir.hpp
src/cpp-common/bt2/value.hpp
src/cpp-common/bt2s/optional.hpp [new file with mode: 0644]
src/cpp-common/optional.hpp [deleted file]
src/cpp-common/vendor/optional-lite/optional.hpp [new file with mode: 0644]
tools/format-cpp.sh
This page took 0.02523 seconds and 4 git commands to generate.