Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::any::{Any, TypeId};
- struct Container<'a>{
- value: &'a u32,
- }
- fn main() {
- let x = 10;
- let cont = Container{value: &x};
- let result = TypeId::of::<Container<'_>>() == cont.type_id();
- println!("Same type? {}", result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement