Closed
Description
Currently you can not pass @
or ~
or @mut
to a macro by itself, but this would be useful in a few cases. I tried doing this to add Clone trait implementations without copying the code:
macro_rules! ptr_clone_impl(
($p:something) => {
impl<T:Clone> Clone for $p T {
#[inline(always)]
fn clone(&self) -> $p T { $p (**self).clone() }
}
}
)
ptr_clone_impl!(~)
ptr_clone_impl!(@)
ptr_clone_impl!(@mut)
But as far as I can tell there is no fragment specifier that will work for those tokens.