Macro moveit::emplace[][src]

macro_rules! emplace {
    ($(let $(mut)? $name:ident $(: $ty:ty)? = $expr:expr);*) => { ... };
}

Emplace a Ctor into a StackBox.

This macro is analogous to the stackbox! macro, except that the RHS must be a Ctor<Output = T> instead of a T, and the resulting type is a Pin<StackBox<T>>.

emplace!(let x = ctor::default::<i32>());
emplace! {
  let y: Pin<StackBox<i32>> = ctor::from(*x);
  let mut z = ctor::new(*y as u64);
}

This macro is a shortcut for calling slot! followed by Slot::emplace().