Or bound by Copy.

On Thu, Jun 12, 2014 at 10:17 AM, Patrick Walton <[email protected]> wrote:
> You could just clone the value to get around that error.
>
>
> On June 12, 2014 10:03:40 AM PDT, Tommi <[email protected]> wrote:
>>
>> On 2014-06-12, at 19:08, Patrick Walton <[email protected]> wrote:
>>
>> On 6/11/14 6:27 AM, SiegeLord wrote:
>>
>> So, I think the situation is pretty bad. What can be done to fix it?
>>
>>
>> Seems to me we can just make the overloaded operator traits take by-value
>> self.
>>
>>
>> I definitely wouldn't want to see something like the following:
>>
>> pub trait GreaterByOne<T> {
>>     fn greater_by_one(self) -> Self;
>> }
>>
>> pub fn my_algorithm<X, T: GreaterByOne<X> + Add<T, T>>(value: T) -> T {
>>     value.greater_by_one() +
>>     value.greater_by_one() // error: use of moved value: `value`
>> }
>>
>
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>



-- 
http://octayn.net/
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to