diff options
| author | ruki <[email protected]> | 2024-04-09 09:37:46 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-09 09:37:46 +0800 |
| commit | c729be0bb01b41b2cdc67f5b5713da239c9ea9a6 (patch) | |
| tree | 0fde774547602aa4a9fd1ce3866c8cbed71f1854 /tests/projects/other/parallel_build/2.cpp | |
| parent | 15af62b0406caefc71ad7fa01c41f29a017759bb (diff) | |
| parent | 19b67001ad77668b555a1213bc6d473bc35318aa (diff) | |
Merge pull request #4947 from xmake-io/runjobs
Improve runjobs
Diffstat (limited to 'tests/projects/other/parallel_build/2.cpp')
| -rw-r--r-- | tests/projects/other/parallel_build/2.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/projects/other/parallel_build/2.cpp b/tests/projects/other/parallel_build/2.cpp new file mode 100644 index 000000000..dd82f0605 --- /dev/null +++ b/tests/projects/other/parallel_build/2.cpp @@ -0,0 +1,31 @@ +// Make this object complex and cost longer compile time... +#include <algorithm> +#include <any> +#include <bitset> +#include <filesystem> +#include <fstream> +#include <iostream> +#include <list> +#include <map> +#include <optional> +#include <queue> +#include <string> +#include <unordered_map> +#include <variant> +#include <vector> + +int main(int argc, char** argv) { + using Type = std::variant<int8_t, uint8_t, int16_t, uint16_t, int32_t, + uint32_t, int64_t, uint64_t, double, float>; + Type a, b, c; + a = 5; + b = 3.0; + c = 4.0f; + double r; + std::visit([&](auto a, auto b, auto c) { r = a + b + c; }, a, b, c); + std::visit([&](auto a, auto b, auto c) { r = a + b - c; }, a, b, c); + std::visit([&](auto a, auto b, auto c) { r = a - b - c; }, a, b, c); + std::visit([&](auto a, auto b, auto c) { r = (a + b + c) * 2; }, a, b, c); + std::visit([&](auto a, auto b, auto c) { r = (a + b - c) * 3; }, a, b, c); + return 0; +} |
