Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. void main()
  2. {
  3. import std.stdio : writefln;
  4. import std.algorithm.sorting : sort;
  5. import std.range : chain;
  6.  
  7. int[] arr1 = [4, 9, 7];
  8. int[] arr2 = [5, 2, 1, 10];
  9. int[] arr3 = [6, 8, 3];
  10. // @nogc functions are guaranteed by the compiler
  11. // to be without any GC allocation
  12. () @nogc{ sort(chain(arr1, arr2, arr3)); }();
  13. writefln("%s\n%s\n%s\n", arr1, arr2, arr3);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement