1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use num_traits::Pow;

use super::Ex3Uint;

#[macro_export(local_inner_macros)]
macro_rules! impl_pow_uint_for {
  ($for_type:ty, $($t:ty),*) => {
    $(
      impl Pow<$t> for $for_type {
        type Output = $for_type;

        fn pow(self, rhs: $t) -> Self::Output {
          <$for_type>::from(self.0.pow(rhs))
        }
      }
    )*
  };
}

impl_pow_uint_for!(Ex3Uint, u8, u16, u32, u64, u128, usize);