摘要:
指针类型 #include <iostream> int main(){ int i = 1; int* a = &i; int *b = &i; int * c = &i; std::cout << "a="<<a << std::endl; // a=0x7ffeb29cf6ac std::co 阅读全文
摘要:
Rc<T>, the Reference Counted Smart Pointer Rc,多引用小指针,可以让一个地址被多个对象引用,每多一个对象,引用个数+1 In the majority of cases, ownership is clear: you know exactly which 阅读全文
摘要:
Box Box是一个指针,具有固定长度, 指针在栈上,指针指向的数据在堆上, 这个复合类型是rust为用户提供的,可以实现递归调用的一个类型,它不会提升性能, 所以,除了递归,一般不用这个. The most straightforward smart pointer is a box, whose 阅读全文