Advertisement
tinyevil

Untitled

Jun 29th, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. class Serializable[T]{
  2.     method serialize(val:ref T, emitter:ref ExpressionEmitter):ref Expression;
  3. }
  4.  
  5. instance Serializable[i32]{
  6.     method serialize(val:ref i32, emitter:ref ExpressionEmitter):ref Expression{
  7.         return emitter.buildIntLiteral(i32, val);
  8.     }
  9. }
  10.  
  11. instance Serializable[string]{
  12.     method serialize(val:ref string, emitter:ref ExpressionEmitter):ref Expression{
  13.         return emitter.buildStringLiteral(val);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement