Is it possible not to use snprintf or any other stdio functionalities to throw std::logic_error in standard library containers?

unlvsur unlvsur unlvsur@live.com
Sat May 15 02:25:02 GMT 2021


The issue is that this will silently introduce dependency to stdio. On MinGW-w64 for example, any snprintf function call will bloat binary size for 70kb, that is even we shared linking with both msvcrt and libstdc++.

I frequently see a random bloat because of that.

By the way, it also hurts optimizations since compilers cannot merge them together.

Better just throw an exception with “vector<T> out of bounds” instead of formatting subscriptor.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



More information about the Libstdc++ mailing list