Questions tagged [stl]
The stl tag has no usage guidance.
9 questions
0
votes
1
answer
405
views
Can I use STL on an Arduino Uno?
I started using an Arduino Uno days ago. I'm an experienced C++ dev and I'm kind of confused.
Is the Arduino compiler different than a C++ one? What C++ version does Aruidno Uno use? Why it doesn't it ...
1
vote
1
answer
5k
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) {
...
6
votes
1
answer
6k
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
1
answer
5k
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
1
answer
301
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 <...
6
votes
1
answer
3k
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 ...
1
vote
1
answer
1k
views
How to declare a Dynamic Array?
I want to define an unknown size for an array. However, I know that this cannot be done on the arduino. So what other methods do you suggest? I tried using vectors by downloading the library ...
11
votes
4
answers
22k
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
1
answer
11k
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 ...