fn unary_fn_in_place<U: FnOnce(&mut Self::Elem)>(
        &mut self,
        unary_fn: U,
    ) -> Result<(), crate::StackError> {
        unary_fn(&mut self.x);
        Ok(())
    }
/// Appy a unary operation to the X register in-place.
///
/// # Example
///
/// ```
/// use smsflib::prelude::*;
///
/// let mut stack = ClassicStack::<u32>::new(1, 2, 3, 4);
/// let res = stack.unary_fn_in_place(|x: &mut u32| {*x += 10; } );
///
/// assert_eq!(res, Ok(()));
///
/// assert_eq!(*stack.x(), 11);
/// assert_eq!(*stack.y(), 2);
/// assert_eq!(*stack.z(), 3);
/// assert_eq!(*stack.t(), 4);
/// ```
Appy a unary operation to the X register in-place.
Appy a unary operation to the X register in - place .
fn unary_fn_in_place<U: FnOnce(&mut Self::Elem)>(
        &mut self,
        unary_fn: U,
    ) -> Result<(), crate::StackError> {
        unary_fn(&mut self.x);
        Ok(())
    }
fn unary_fn_in_place < U : FnOnce ( & mut Self :: Elem ) > ( & mut self , unary_fn : U , ) -> Result < ( ) , crate :: StackError > { unary_fn ( & mut self . x ) ; Ok ( ( ) ) }
Appy a unary operation to the X register in-place.
Appy a unary operation to the X register in - place .
&mut self
unary_fn
U
example
```
use smsflib::prelude::*.






` ` ` use smsflib :: prelude :: * .