use objc2_encode::{Encode, Encoding, RefEncode};
#[repr(transparent)]
struct NSUInteger {
_inner: usize,
}
unsafe impl Encode for NSUInteger {
const ENCODING: Encoding<'static> = usize::ENCODING;
}
unsafe impl RefEncode for NSUInteger {
const ENCODING_REF: Encoding<'static> = Encoding::Pointer(&NSUInteger::ENCODING);
}
fn main() {
assert!(NSUInteger::ENCODING.equivalent_to_str("Q"));
assert!(<&NSUInteger>::ENCODING.equivalent_to_str("^Q"));
assert!(<&NSUInteger>::ENCODING.equivalent_to_str("r^Q"));
}