Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Gee;
- void main(string[] args){
- int[] table = new int[]{1,2,5,3,23};
- Query<int> query = new Query<int>.from(table);
- foreach(int i in query)
- stdout.printf("%d\n",i);
- }
- public class Query<T> : ArrayList<T>
- {
- public Query(){}
- public Query.from(T[] array){
- foreach(var item in array)
- add(item);
- }
- }
- /* output :
- 1
- 5
- 23
- 113
- 2 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement