Advertisement
rotrevrep

special test

Aug 1st, 2013
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 0.37 KB | None | 0 0
  1. using Gee;
  2.  
  3. void main(string[] args){
  4.     int[] table = new int[]{1,2,5,3,23};
  5.     Query<int> query = new Query<int>.from(table);
  6.     foreach(int i in query)
  7.         stdout.printf("%d\n",i);
  8. }
  9.    
  10.     public class Query<T> : ArrayList<T>
  11.     {
  12.         public Query(){}
  13.        
  14.         public Query.from(T[] array){
  15.             foreach(var item in array)
  16.                 add(item);
  17.         }
  18.     }
  19.  
  20. /* output :
  21. 1
  22. 5
  23. 23
  24. 113
  25. 2 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement