2015-08-27 9:58 GMT-03:00 Hartmut Kaiser
Third, the terminology 'consuming' and 'non-consuming' future does not make any sense (to me). More importantly it is by no means Standard-terminology - thus reasoning in terms of those makes it much more difficult for us to talk about the same thing.
I thought this was standard terminology. Anyway, maybe I can help here. I know Niall had played with Rust for sometime[1] (and end up eventually hating for the lack of an asynchronous foundation[2]). I too end up playing with Rust for some time and maybe that's why I understood Niall without trouble. Anyway, moving on. Rust "stole" lots of terms from previously established languages. From C++, there was also move semantics. In Rust, move semantics was absorbed way earlier than in C++, so there was chance to make better design. One example where Rust design is superior is the fact that several errors discussed in this thread would be detected at compile-time, not runtime. Anyway, a value that was consumed is a value that cannot be used again. There are consuming operations that will consume the value. It's closely related to the move idea, where the moved value is left in an unspecified state. There are moving operations and there are consuming operations, but consuming operations work on values other than rvalues too. Imagine a range that invalidates the original container. It *consumes* the container. Does that explanation help? [1] https://plus.google.com/+nialldouglas/posts/AXFJRSM8u2t [2] This is just my impression, I have no evidence -- VinÃcius dos Santos Oliveira https://about.me/vinipsmaker