Rust in the Linux kernel (Google security blog)
Rust in the Linux kernel (Google security blog)
Posted Apr 23, 2021 19:59 UTC (Fri) by mss (subscriber, #138799)In reply to: Rust in the Linux kernel (Google security blog) by Cyberax
Parent article: Rust in the Linux kernel (Google security blog)
> It's the only way to return errors from constructors, for example.
Many C++ projects manage to use this language without resorting to exceptions.
It depends on a class, but it it often possible to initialize object to a dummy state in case of an unexpected error in a constructor
(like a NULL pointer in case of a smart pointer template, empty string for a string template, etc.).