ExpandCollapsePrev Next Index

+ 2.1 stl-1.01.02-0.flx

  //Check stl:Vector
  //Check stl:Map
  include "stl/stl_vector";
  include "stl/stl_map";
  
  typedef ii = Stl_Vector::iterator[int];
  
  var v = Stl_Vector::create[int]();
  push_back (v,1);
  push_back (v,2);
  push_back (v,3);
  
  var j = 0; until j==3 do
    print v.[j.size]; endl;
    ++j;
  done;
  
  
  var m = Stl_Map::create[int,int]();
  
  insert(m,0,2);
  insert(m,1,23);
  insert(m,2,423);
  
  j = 0; until j==3 do
    print m.[j]; endl;
    ++j;
  done;
  
  
  var i = begin m; until i == end m do
    def val k, val vl = deref i;
    print k; print " -> "; print vl; endl; ++i;
  done;
  

1
2
3
2
23
423
0 -> 2
1 -> 23
2 -> 423