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