collections::boxed::HEAP

Constant collections::boxed::HEAP

pub const HEAP: ExchangeHeapSingleton = ExchangeHeapSingleton{_force_singleton: (),}
???? This is a nightly-only experimental API. (box_heap #27779)may be renamed; uncertain about custom allocator design

A value that represents the heap. This is the default place that the box keyword allocates into when no place is supplied.

The following two examples are equivalent:

#![feature(box_heap)]

#![feature(box_syntax, placement_in_syntax)]
use std::boxed::HEAP;

fn main() {
    let foo: Box<i32> = in HEAP { 5 };
    let foo = box 5;
}

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/collections/boxed/constant.HEAP.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部