aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project')
-rw-r--r--vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/CMakeLists.txt7
-rw-r--r--vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/main.cpp17
2 files changed, 24 insertions, 0 deletions
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/CMakeLists.txt b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/CMakeLists.txt
new file mode 100644
index 0000000..79c30f2
--- /dev/null
+++ b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.25.1)
+project(mapbox-variant-test LANGUAGES CXX)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+find_package(unofficial-mapbox-variant CONFIG REQUIRED)
+add_executable(main main.cpp)
+target_link_libraries(main PRIVATE unofficial::mapbox-variant::variant)
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/main.cpp b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/main.cpp
new file mode 100644
index 0000000..1f59c1a
--- /dev/null
+++ b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/main.cpp
@@ -0,0 +1,17 @@
+#include <mapbox/variant.hpp>
+#include <stdexcept>
+struct check
+{
+ template <typename T>
+ void operator()(T const& val) const
+ {
+ if (val != 0) throw std::runtime_error("invalid");
+ }
+};
+int main()
+{
+ typedef mapbox::util::variant<bool, int, double> variant_type;
+ variant_type v(0);
+ mapbox::util::apply_visitor(check(), v);
+ return 0;
+}