Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- instance IndexGet Map[K,V] K {
- function index_get(self:ref Map[K,V], key:ref K):ref V{
- ....
- }
- }
- instance IndexSet Map[K,V] K V {
- function index_set(self:ref Map[K,V], key:ref K, value:ref V){
- ....
- }
- }
- var m:Map[i32, i64] = ...;
- m[1] = 2; //index_set(&m, &1, &2);
- var x:i64 = m[1]; //*index_get(&m, &1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement