mirror of
https://git.intege.rs/xlib/x.git
synced 2025-12-05 20:35:01 +00:00
util operators
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
// PE stuff
|
// PE stuff
|
||||||
// ==============================
|
// ==============================
|
||||||
|
|
||||||
use core::ops::Range;
|
use core::ops::{Add, Range, Sub};
|
||||||
use crate::upcast::Upcast;
|
use crate::upcast::Upcast;
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
@@ -286,3 +286,18 @@ impl<'a> Iterator for ExportIter<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
impl Add<usize> for &ImageBase {
|
||||||
|
type Output = usize;
|
||||||
|
fn add(self, rhs: usize) -> Self::Output {
|
||||||
|
(self as *const _ as usize) + rhs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Sub<usize> for &ImageBase {
|
||||||
|
type Output = usize;
|
||||||
|
fn sub(self, rhs: usize) -> Self::Output {
|
||||||
|
(self as *const _ as usize) + rhs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user