Questions tagged [raii]

Resource Acquisition Is Initialization (RAII) is a common idiom used in C++ to manage the lifetime of resources, including memory allocations, file handles or database connections. In brief, every resource should be wrapped in an owning class, whose lifetime controls the lifetime of the resource.

2 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
43 views

Generalizing std::shared_ptr for all handle-types, even non-pointers

I created this shared pointer mainly to use it as RAII for handles that have to be shared between classes or threads. For pointers: It supports raw pointers and pointer to classes and arrays and also ...
1
vote
0answers
375 views

Shared_Ptr Implementation

I have tried to Implement Shared_Ptr and learned a lot while Implementing it. So guys please review my Implementation. Any Suggestions,Feed backs are highly appreciated. and Thanks in Advance. Asad. ...