logoalt Hacker News

aw1621107 • today at 4:50 PM • 1 reply • view on HN

You don't really need C++-style constructors for RAII though. Rust implements similar semantics as C++ in that regard and constructors aren't a thing there.


Replies

layer8 • today at 6:43 PM

Rust doesn’t have implementation inheritance. If it did, it would need some constructor-like concept as well to enforce encapsulation between inherited implementation and inheriting implementation.

➕ show 1 reply