Advertisement
tinyevil

Untitled

Jul 31st, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. instance IndexGet Map[K,V] K {
  2. function index_get(self:ref Map[K,V], key:ref K):ref V{
  3. ....
  4. }
  5. }
  6.  
  7. instance IndexSet Map[K,V] K V {
  8. function index_set(self:ref Map[K,V], key:ref K, value:ref V){
  9. ....
  10. }
  11. }
  12.  
  13.  
  14. var m:Map[i32, i64] = ...;
  15.  
  16. m[1] = 2; //index_set(&m, &1, &2);
  17. var x:i64 = m[1]; //*index_get(&m, &1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement