Questions tagged [stl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
36 views

How do I use lambda functions in Arduino?

I want to pass a lambda function as an argument to a method. Example: T reduce(const T initial, const std::function<T(T, T)> acc) { T value = initial; for (size_t i = 0; i < S; ++i) { ...
3
votes
1answer
814 views

How can I make std::cout write to Serial?

I'm using an Arduino MKR WiFi 1010, a SAMD ARM Cortex M3 board. I rely on the standard library a lot, using things like std::vector<> and std::string. I also want to use std::cout. I've managed ...
1
vote
1answer
824 views

Is std::array (from the C++ STL) safe to use on arduino? Does it use dynamic memory allocation?

I'd like to use std::array on a project that will need to be very stable, and have all memory pre-allocated to avoid heap fragmentation. I am reading in characters from the serial port, following a ...
1
vote
1answer
88 views

Dynamically create functions for AccelStepper that use Adafrut_StepperMotor.oneStep methods?

In the Adafruit_MotorShieldV2Library>Accel_MultiStepper example, AccelSteppers are initialized using the following static forwardstep1 and backwardstep1: #include <Wire.h> #include <...
2
votes
0answers
659 views

Is there any working analogue to the pair std::function and std::bind in Arduino?

Both ArduinoSTL and StandardCplusplus don't support them. They implement the version that is compatible with c++03 (not c++11). This functionality is handy when you design libraries that work with ...
7
votes
4answers
15k views

Is the C++ STL fully supported on Arduino?

I don't yet own an Arduino board to run code on, and as the title says, I'm curious if the C++ STL is fully supported on Arduino and already part of the Arduino IDE. The STL is probably the most ...
5
votes
2answers
10k views

Current Arduino STL Libraries

I was going to update this question but I thought that this was different. I have been trying to get std::vector to work with the latest Arduino. I have tried downloading several libraries found ...