It is my understanding that std::pair
and std::tuple
are basically compile-time constructs that don't require any particular runtime support, and can be implemented (if messily) purely using template constructs.
So why is it that when I #include <tuple>
in my bare metal project from arm-none-eabi
's C++ standard library, it includes <array>
which includes <stdexcept>
which finally includes <string>
, making it impossible for me to include it as this then reaches into headers like wchar.h
and bits/postypes.h
that aren't included in arm-none-eabi-gcc? What am I doing wrong?
I can use std::pair
just fine from <utility>
but std::tuple
just won't work without me editing the C++ standard library headers to remove the offending include, which is clearly unacceptable.
Is this an oversight or limitation that effectively prevents bare metal programs from using perfectly legitimate parts of the STL, or am I supposed to be doing something more here? Do I need to provide my own wchar.h
and other headers??
I would really appreciate an explanation of what the authors of those headers are expecting here.