Add `std::optional` replacement (`nonstd::optional`)
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 27 Jan 2022 16:41:55 +0000 (11:41 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 28 Jan 2022 16:22:26 +0000 (11:22 -0500)
commitdba8555979d55f701c773da6d07e9039df5fd19c
tree2c068adb31d396a13620a9c5c72bd6db9b5bf82f
parent01bf7a3a1fbc42bb8b069793619ca786f52ca6de
Add `std::optional` replacement (`nonstd::optional`)

This patch adds an `std::optional` replacement, `nonstd::optional`,
which comes from the Boost-licensed
<https://github.com/martinmoene/optional-lite> project.

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

`nonstd::optional` is meant to work like C++17's `std::optional`.

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

    #include "cpp-common/optional.hpp"

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