Y
Hacker News
new
|
ask
|
show
|
jobs
by
IshKebab
75 days ago
No, Rust is the same as C++ in terms of tracking side effects. It doesn't matter that there are no parameters. It could manipulate globals or call other functions that have side effects (e.g. printing).
1 comments
functional_dev
75 days ago
What about rust
const fn()
? I think it guarantees there are no side effects
link
IshKebab
75 days ago
I think you're right. Equivalent to C++'s constexpr.
link