]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | /* Copyright 2020 Rene Rivera |
2 | * Distributed under the Boost Software License, Version 1.0. | |
1e59de90 | 3 | * (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) |
f67539c2 TL |
4 | */ |
5 | ||
6 | /* | |
7 | This program is a compile test for support of C++11. If it compiles | |
8 | successfully some key parts of C++11 the B2 engine requires are | |
9 | available. This is used by the build script to guess and check the | |
10 | compiler to build the engine with. | |
11 | */ | |
12 | ||
1e59de90 | 13 | // Some headers we test... |
f67539c2 | 14 | #include <thread> |
1e59de90 | 15 | #include <memory> |
f67539c2 TL |
16 | |
17 | ||
18 | int main() | |
19 | { | |
20 | // Check for basic thread calls. | |
1e59de90 TL |
21 | // [2020-08-19] Mingw-w64 with win32 threading model (as opposed to posix |
22 | // threading model) does not really have std::thread etc. Please see comments | |
23 | // in sysinfo.cpp. | |
24 | #ifndef _WIN32 | |
f67539c2 | 25 | { auto _ = std::thread::hardware_concurrency(); } |
1e59de90 TL |
26 | #endif |
27 | ||
28 | // [2021-08-07] We check the following C++11 features: brace initialization, | |
29 | // unique_ptr. Plus the author's ability to memorize some digits. | |
30 | { const std::unique_ptr <float> pf {new float {3.14159f}}; } | |
f67539c2 | 31 | } |