tinyevil

Untitled

Aug 9th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. function make_unique[T, Args:...Types]
  2.     (
  3.         cons:ref (Args..., out T):unit,
  4.         args:Args...
  5.     ):unique_ptr[T]{
  6.    
  7.     let node = malloc[T]();
  8.     cons(args..., node as &out);
  9.     return unique_ptr[T]{node=node};
  10. }
Add Comment
Please, Sign In to add comment