6 ms·
> If WG21 were handling Rust instead f64 would implement Ord, and people would just write unsafe blocks with no explanation in the implementation of supposedly
by justcuriousab 1y ago
> If WG21 were handling Rust instead f64 would implement Ord, and people would just write unsafe blocks with no explanation in the implementation of supposedly "safe" functions. Rust's technology doesn't care but their culture does.
But Rust allows pattern matching on floats.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=a732d173c98ece1e58b3272015d1dae6 https://play.rust-lang.org/?version=stable&mode=debug&editio...
Rust Zulip is C++ WG21 confirmed?
- tialaramex 1y agoI'm sure you think this was somehow succinctly making your point, but I can't see any connection at all, so if you did have an actual point you're going to need to explain it.
- justcuriousab 1y agoFloat matching in Rust is not supported due to correctness concerns, but due to historical accidents and backwards compatibility. https://github.com/rust-lang/rust/issues/41620#issuecomment-817075316 https://github.com/rust-lang/rust/issues/41620#issuecomment-... https://github.com/rust-lang/rust/pull/84045#issuecomment-828196552 https://github.com/rust-lang/rust/pull/84045#issuecomment-82...
- tialaramex 1y agoOK? I don't see how that's connected? It's not controversial that f32 and f64 are partially ordered, the problem in C++ is that the difference between "Partially Ordered" and "Totally Ordered" is semantic not syntactic in their language and all semantic mistakes are just IFNDR so it's a footgun.
- deleted 1y ago[deleted]