I’d just recommend using the 3 lines of platformio.ini
instructions in the two posts ESP32-Arduino - platformio support for 2.0.0 version to get a 2.0.0 core beta version. They updated their code to C++17 without you having to do any build_flags
modifications, so for sure the C++14 things you need are also there.
Technically yes, see Redirecting.... You can, via scripting, modify env["CXXFLAGS"]
for specific source files to something else.