-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
I have a C++ library which I'm porting to work on Zephyr. This uses the Zephyr Bluetooth API. I have successfully linked the library during its development and have most functionality working. For ease I'd like to use std::async and std::future in my code for my library. If I do this, I cannot currently port it to Zephyr. (Compile error below). I note the previous catch-all issues #18554 #31281.
Describe the solution you'd like
I would like support for std::async and std::future please. (I realise this implies other C++17 functionality needs implementing too)
Describe alternatives you've considered
Adding my own template primitives when std library support isn't available - but this of course leads to complexity in the library.
Additional context
I'm more than happy to assist in writing and testing this as it would be ideal for a COVID-19 project I'm working on ( https://github.com/vmware/herald-for-cpp ). I have several Nordic DK boards for testing.
herald-for-cpp/herald/src/engine/coordinator.cpp:152:23: error: variable 'std::future<void> fut' has initializer but incomplete type
[build] std::future<void> fut = std::async(std::launch::async,
[build] ^~~
[build] D:/git/skunkworks/herald-for-cpp/herald/src/engine/coordinator.cpp:159:6: error: invalid use of incomplete type 'class std::future<void>'
[build] });
[build] ^
[build] In file included from D:/git/skunkworks/herald-for-cpp/herald/src/engine/coordinator.cpp:16:
[build] c:\gnuarmemb\arm-none-eabi\include\c++\8.3.1\future:125:11: note: declaration of 'class std::future<void>'
[build] class future;