Yelyzaveta Dymchenkodymchenko.hashnode.dev·Nov 25, 2024Self-Referential Structs in Rust: Memory Allocation ExplainedIntroduction to Self-Referential Structs Self-referential structs are structures where one or more fields in the struct contain references to another instance of the same struct type. This pattern is common in scenarios like creating linked data stru...self-referential
Learn CPlusPluslearncplusplus.hashnode.dev·May 20, 2024An Introduction to Smart Pointers by Learn CPlusPlusA smart pointer is an advanced pointer in programming that automatically manages memory and resource allocation. Unlike traditional pointers, smart pointers handle object destruction when the object is no longer in use, preventing memory leaks and da...smart pointer
fokirfokir.hashnode.dev·May 13, 2024Pointers & Memoryit's just an address, a way to locate where something that is stored in your computer's memory. Just like GPS helps you find your way around town, pointers help your program find its way around memory. There are three main operators &(ampersand) give...cpp
Learn CPlusPluslearncplusplus.hashnode.dev·Mar 15, 2024Smart Pointer | Learn CPlusPlusA smart pointer in C++ is a class that wraps a raw pointer and provides additional functionalities for memory management. Unlike raw pointers, which require manual memory allocation and deallocation, smart pointers automatically manage the memory all...smart pointer
Raineraineyang.hashnode.dev·Dec 20, 2023Rust Learning Note: Smart PointerThis article is a summary of Chapter 4.4 in Rust Course (course.rs) Box<T> Box is used to allocate a value in the heap, and creates a pointer on the stack pointing to the value. It has these common uses: 1 Allocate values on the heap Using Box, we ca...deref
Aayush Vermaalphavictor.hashnode.dev·Oct 9, 2023Memory Management in C++Managing memory is very crucial for stable and efficient C++ applications. Unlike Java, Python or Javascript which automatically identify and dispose of unused memory, making life easier for developers, C++ lack this capability. This is possible due ...40 readssmart pointer
Aryan Kspaciouscoder78.hashnode.dev·May 14, 2023Garbage Collection In C++C++ is a very popular general-purpose programming language that's generally used in high-performance applications, operating systems, embedded systems and many more low-level areas. It's a very fast language, it's well known for its performance and r...38 readsProgrammingC++
qilingzhaoqilingzhao.com·Jul 9, 2022C++智能指针std::unique_ptr 对于独占资源(exclusive-ownership resource)使用std::unique_ptr,它禁止和其他智能指针共享对象 使用 与std::shared_ptr只有单个对象形式不同, std::unique_ptr有两种形式, 对于单个对象(std::unique_ptr<T>), 对于数组(std::unique_ptr<T[]>), 对于解引用操作符(operator*和operator->)对于单个对象专有。 std::unique_ptr<...51 readsC++