C++ Standard Library

Hi, my name’s Michael, I’m a professional C/C++ developer and have been working on a ISO-compliant C++ Standard Library for the Arduino for a few years. I have stable release here: GitHub - Michael-Brodsky/PG: Rapid application development tools for avr/samd/megaavr architectures (Arduino, STMicro, Teensy). and would like some feedback on the implementation. There’s some basic instructions in the readme files, otherwise it should perform like any other library. Any comments or suggestions would be appreciated. NOTE: the library requires named namespace support, so you’ll need a version of the Arduino IDE that has it. I’m using v 1.8 (the latest).

After spending a few years on the development, I would recommend to spend a few days on documentation. I tried to find the purpose and meaning of your library by browsing through your github folders, but failed to find that sort of documentation.

It’s an implementation of a C++ Standard Library for the Arduino. It states that clearly in the first readme.md. Try here for starters C++ Standard Library headers - cppreference.com

couldn’t find std::string or std::vector

Haven’t uploaded those yet. I concentrated on stuff that could easily be implemented in terms of std::array. They’ll be something like the way I made std::forward_list, the underlying allocator is std::array which sets its max capacity, but it’s “size” varies with the actual number of elements inserted, up to the size of the allocator. std::begin, ::end, algorithms, etc only see this “size” (allegedly).

I’m well aware that both would present a challenge to implement for Arduino so was curious to see how you did it (didn’t it)

Yeah, there’s always gonna be some funkiness. My design philosophy was that embedded developers avoid dynamic memory whenever possible (it’s so bad in the avr implementation that I even stay away from stuff like the String class). Basically you’ll have to determine the max size of your containers at compile-time, and and use a common size because containers with different allocators are different types, but that’s true in any implementation - std::vector with different allocators are different types too. I try to upload stuff daily so hopefully it’ll be more complete soon.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.