Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template T10(T)
- {
- void t10(ref T data, uint dim)
- {
- foreach(ref elem; data)
- {
- if (dim > 1)
- T10(typeof(elem)).t10(elem, dim-1);
- else
- foreach(ref i; elem)
- i = 0;
- }
- }
- }
- int main()
- {
- int[][] data = [[1,2,3], [4,5,6]];
- T10!(int[][]).t10(data, 2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement