Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. macro_rules! build {
  2. ($($case:ty),*) => { enum Test { $($case),* } };
  3. }
  4.  
  5. fn main() {
  6. build!{ Foo(i32), Bar(i32, i32) };
  7. }
  8.  
  9. macro_rules! build {
  10. ($($case:ty),*) => { enum Test { Foo(i32), Bar(i32, i32) } };
  11. }
  12.  
  13. fn main() {
  14. build!{ Foo(i32), Bar(i32, i32) };
  15. }
  16.  
  17. macro_rules! build {
  18. ($($case:ident),*) => { enum Test { $($case),* } };
  19. }
  20.  
  21. fn main() {
  22. build!{ Foo, Bar };
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement