Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Jan 23rd, 2019
117
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.19 KB
| None
|
0
0
raw
download
clone
embed
print
report
#![allow(unused)]
fn add_one<T: AsMut<u64>>(num: &mut T) {
*num.as_mut() += 1;
}
fn main() {
let mut boxed_num = Box::new(0);
add_one(&mut boxed_num);
assert_eq!(*boxed_num, 1);
}
Add Comment
Please,
Sign In
to add comment
Public Pastes
01 Hello SoftUni
Java | 50 sec ago | 0.14 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 10 min ago | 0.39 KB
AI
Python | 20 min ago | 3.50 KB
Untitled
C# | 25 min ago | 0.24 KB
Untitled
C++ | 41 min ago | 2.26 KB
Untitled
C++ | 41 min ago | 2.06 KB
Untitled
C++ | 42 min ago | 2.26 KB
Untitled
C++ | 42 min ago | 1.98 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!