so currently i am investigating the possibility in using a pure C++17 Project for an embedded device (Cortex m4). But based on the fact that it is an embedded device we have port and use an RTOS Such as FreeRTOS or uc-OS and i would highly prefer in using the std::thread (So we can easily exchange the RTOS if it is required). Is there a way to override the thread class in C++ to use the platform depended RTOS?
Thanks in advance
There is no way to tell
std::threadto use useFreeRTOS::thread(made this up) but you can use conditional compilation and a type alias likeAnd n ow
thread_twill be the thread type from the implementation and falls back tostd::threadif no symbols are found.