errno the ugly duckling

Tove tove at
Fri Dec 6 12:48:43 UTC 2019

+ Best solution for rare errors
+ Best general error-handling mechanism

No matter which error camp you belong to, errno is universally 

Before TLS support became ubiquitous, global errno was useless, 
with TLS it's no longer a real problem, now can we improve errno 
even futher?
Exception last_error; // TLS & Rich error info

+ Zero-cost in hot-path
+ Decent performance in error-path (Better than Exceptions)
- No support for fibers
- Not pure

I'm not claming this is the best general error-handling 
mechanism, it's not suitable for a standard library etc.

I'm just wondering, does this fill a niche for certain libraries.

More information about the Digitalmars-d mailing list