2025-05-27 02:32:22 +10:00
|
|
|
/// A pointer type that uniquely owns a heap allocation of type T.
|
2024-04-02 22:46:00 +00:00
|
|
|
///
|
2025-05-27 02:32:22 +10:00
|
|
|
/// This used to be its own type, but now it's just a typedef for `Box` and we are planning to
|
|
|
|
|
/// remove it soon.
|
|
|
|
|
pub type P<T> = Box<T>;
|
2014-05-18 00:46:40 +03:00
|
|
|
|
2014-05-20 00:12:17 +03:00
|
|
|
/// Construct a `P<T>` from a `T` value.
|
2019-06-12 09:41:00 +03:00
|
|
|
#[allow(non_snake_case)]
|
2025-05-27 01:57:43 +10:00
|
|
|
pub fn P<T>(value: T) -> P<T> {
|
2025-05-27 02:32:22 +10:00
|
|
|
Box::new(value)
|
2015-01-03 22:24:50 -08:00
|
|
|
}
|