Guest User

Untitled

a guest
Mar 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. fn main() {
  2. Sum(0) + 1;
  3. 1 + Sum(0);
  4. }
  5.  
  6. struct Sum(usize);
  7.  
  8. use std::ops::Add;
  9. impl Add<usize> for Sum {
  10. type Output = Sum;
  11. fn add(self, rhs: usize) -> Self::Output {
  12. Sum(self.0 + rhs)
  13. }
  14. }
Add Comment
Please, Sign In to add comment