vendredi 10 janvier 2020

Using C++11 with move semantics - without the standard library (and with Boost.smart_ptr)

I’m working on embedded projects, using Zephyr RTOS with ARM embedded microcontrollers like STM32 Nucleo series (Cortex M4/0).

Recently, due to significant C++ support improvements in the recent versions of Zephyr, I’m considering to move from C development to modern C++.

By default, Zephyr includes C standard library, but not Cpp’s STD.

Zephyr actually added optional support for Cpp’s standard library, which seems to work pretty well. However, it requires huge flash memory usage (near 65% of my microcontrollers flash memory, without my code!).

So I’m trying to search for alternative ways to use modern C++ without the actual standard library (including the memory/utility headers).

I’ve considered to use Boost.smart_ptr for smart pointers, but I’m wondering how I should use move semantics (std::move) In my case.

Should I use Boost.Move module? Even though I’m using C++1x and not C++0x?

Should I implement move semantics by myself using direct cast from T& to T&&?

Aucun commentaire:

Enregistrer un commentaire