3 ms·
But you can do that with fmtlib/std::format as well when you provide formatting for custom types, that just becomes: fmt::println("Player is at {}", _playe
by diath 3y ago
But you can do that with fmtlib/std::format as well when you provide formatting for custom types, that just becomes:
fmt::println("Player is at {}", _player_pos);
- petters 3y agoShould be possible to implement cout more effectively since there is no string parsing. I say “should” because in practice it seems to be the other way around. I don’t know why.
- hermitdev 3y agoBeen a while since I've looked at it, but pretty sure std::format validates and parses most (all?) format strings at compile time. There should be no runtime penalty.
- vitaut 3y agoThere are some fundamental reasons why cout is slower than stdio/{fmt}: https://stackoverflow.com/a/65325727/471164 https://stackoverflow.com/a/65325727/471164.