C++ why don’t we just throw std::error_code’s ?

So little C++ so much good!
So little but so much good!

The simple question, that hit me the other day, is why don’t we just throw std::error_code or std::error_conditon.

Let me try and calmly observe.

  • This is not using RTTI.
  • This is not dynamic types catching.
  • This is throw and catch by value.

What are the drawbacks of this for new standard C++ projects? There must be some, but right now I am having difficulties to find them drawbacks.

For throwing this from public API, this renders the API not “std::exception friendly”. But right now, it seems we have the right not to care. That is the sentiment in the C++ community at large.

Is this leading to fast(er) code , even if /EH switch is used?

C++ Windows Unicode Console Output

Update 2018 12 07

The key problem, as explained here, is now acknowledged by Visual Studio / MSVC team. Please follow here.

Update 2018 12 05

Many thanks to many of you visiting this post every day.  As a “reward”, I have made the small console app to help you set up your Windows console to show UTF-8 text properly.

DBJ UTF8 Console set up aid

This little program is, of course, free and you can download it (zipped) from here, straight awayContinue reading “C++ Windows Unicode Console Output”