It is an undesirable to include <iostream> for freestanding compilers. This is especially true for embedded devices that do not have a cout. As you can see in this example https://godbolt.org/z/8vrdv8 call to std::ios_base::Init::Init() cannot be optimized even if you dont use cout and even at maximum optimization level. But this is still add overhead by increasing compilation time, producing larger binaries and increasing startup time.
It is an undesirable to include
<iostream>
for freestanding compilers. This is especially true for embedded devices that do not have acout
. As you can see in this example https://godbolt.org/z/8vrdv8 call tostd::ios_base::Init::Init()
cannot be optimized even if you dont usecout
and even at maximum optimization level. But this is still add overhead by increasing compilation time, producing larger binaries and increasing startup time.