Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust doesn't have static initialisers for complex objects; it has lazy initialisers in the standard library that run when they're first requested, but there's no way to statically initialise any object more complex than a primitive: https://doc.rust-lang.org/reference/items/static-items.html#...


Thanks, I stand corected. Rust does not allow to initialize globals with arbitrary code running before main even with unsafe.

One more point to consider Rust over C++.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: