Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. fn typeid<T: std::any::Any>(_: &T) -> std::any::TypeId {
  2. let result = std::any::TypeId::of::<T>();
  3.  
  4. result
  5. }
  6.  
  7. fn main() {
  8. let arch_match = 2.0;
  9. println!("{:?}", typeid(&arch_match));
  10. }
  11.  
  12. // prints this:
  13. // TypeId { t: 14742493193654942124 }
  14.  
  15. // I was expecting it to print some sort of string indicating it was a float?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement