An abstract data type that simulates a pointer while providing additional features, such as automatic garbage collection or bounds-checking.

learn more… | top users | synonyms

5
votes
2answers
104 views

Proposed solution to dangling pointers: a non-owning smart pointer

The lifetimes of various objects referring to each other are sometimes only known at runtime. For example, in a side scrolling shooter game, a HomingMissile ...
1
vote
2answers
115 views

Smart pointer implementation

I've decided to implement a simple smart pointer: ...
3
votes
3answers
618 views

Singly linked-list with smart pointers

A few things: I tried to do it with smart pointers because I wanted to learn about them. I'm not sure I made the right choice of type, however (and started to regret it half-way through). This is ...
3
votes
0answers
221 views

yet another shared pointer

What might be wrong with this shared pointer? One good point of it might be, that it should handle array types correctly by default (e.g. ...
10
votes
2answers
379 views

make_auto implementation for C++03 compilers

I want to provide, in the the spirit of C++11/boost make_shared and C++14 make_unique, a production-ready make_auto for C++03 compilers. So, inspired boost's make_shared implementation for C++03 ...
4
votes
1answer
1k views

efficient smart pointer implementation in C++

So the idea behind this is mainly educational but I might even consider using it in reality if turns out to be good. Here's my first try at implementing ...
3
votes
4answers
184 views

Request for review: reference counting smart pointer

I made a reference counting smart pointer class. My aim is to make a "minimal" but "general purpose" smart pointer class with proper documentation. This is basically for educational purpose. Please ...
7
votes
2answers
153 views

Am I using copy ctors/move ctors/shared_ptr correctly?

Here is my simple example: there is a class A with few primitive members and a class B with few primitive members but also a collection of objects of type A. This is my A class: ...
3
votes
0answers
236 views

A pointer vector sorted by its member function

Ask for suggestion on a random accessed vector with allocated elements sorted by its key obtained from its member function. I use it with Qt tree view where the access, add and deletion of tree items ...
1
vote
1answer
704 views

Shared Pointer implementation

Before you say anything: Due to project constraints, we cannot use Boost and we cannot use C++11 (yet; perhaps this will change some day). The fact that I was unable to use smart pointers was nagging ...
10
votes
1answer
2k views

scoped_ptr for C++/CLI (ensure managed object properly frees owned native object)

Motivating SO question: Is there a C++/CLI smart pointer project (e.g. scoped_ptr)? I'm interested in any reviewer comments, and especially identified bugs or inconsistencies with the native ...