Stl_algobase.h:195:5: error: expected unqualified-id before 'const' min(const _Tp& __a, const _Tp& __b) ^~~

Duplicate of Seeed wio terminal - atmelsam - std::vector - #4 by maxgerhardt.

#include <Arduino.h> // poisons all following includes with its min&max defs
#undef min
#undef Min
#undef max
#undef Max
#include <algorithm>

before including any STL header, or the Arduino core’s definition of min & max will screw up the header.