Function konst::ptr::is_null[][src]

pub const fn is_null<'a, T: ?Sized>(ptr: *const T) -> bool
This is supported on crate feature rust_1_56 only.
Expand description

Const equivalent of <*const>::is_null

Example

use konst::ptr;

use core::ptr::null;

const NULL_IS_NULL: bool = unsafe{ ptr::is_null(null::<u8>()) };
const REFF_IS_NULL: bool = unsafe{ ptr::is_null(&100) };

assert_eq!(NULL_IS_NULL, true);
assert_eq!(REFF_IS_NULL, false);