Using STL in platformio for arduino atmelsam causes build errors

Hi everyone. So I’m trying to use the STL in my project. I’m building for an ARduino MKR WiFi 1010 and I constantly receive these build errors:

Here is my platformio.ini:

[env:mkrwifi1010]
platform = atmelsam
board = mkrwifi1010
board_build.mcu = samd21g18a
framework = arduino
lib_deps = 
	arduino-libraries/WiFiNINA@^1.8.0
	arduino-libraries/ArduinoBLE@^1.1.3
	bblanchon/ArduinoJson@^6.17.2

I’ve also tried ArduinoSTL and ETL and they’ve also caused build issues. Is there some way to make this work?

The Arduino.h macros for min and max conflict the standard library’s definition of the templated std::min and std::max functions. #undef both macros before including STL headers.