summaryrefslogtreecommitdiff
path: root/scripts/vendor/optional.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vendor/optional.sh')
-rwxr-xr-xscripts/vendor/optional.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/vendor/optional.sh b/scripts/vendor/optional.sh
new file mode 100755
index 0000000000..4f65835cc0
--- /dev/null
+++ b/scripts/vendor/optional.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
+
+NAME=optional
+VERSION=fe8fcaf41f271307936289d26846738182946150
+ROOT=optional-lite-$VERSION
+
+download "https://github.com/martinmoene/optional-lite/archive/$VERSION.tar.gz"
+init
+extract_gzip "$ROOT/include" "$ROOT/LICENSE.txt"
+mkdir -p "include/experimental"
+cat << EOF > "include/experimental/optional"
+#pragma once
+
+#include <nonstd/optional.hpp>
+
+namespace std {
+namespace experimental {
+
+template <typename T>
+using optional = nonstd::optional<T>;
+
+using nullopt_t = nonstd::nullopt_t;
+constexpr nullopt_t nullopt = nonstd::nullopt;
+
+} // namespace experimental
+} // namespace std
+EOF
+file_list include -type f