A class, data structure, or abstract data type (ADT) whose instances are collections of other objects.

learn more… | top users | synonyms

7
votes
2answers
403 views

Deallocate all memory in a container of pointers

I want to erase all memory in a container. Currently I'm using this : ...
2
votes
0answers
56 views

Associative container that produces a unique, instance specific handle for each inserted object

It is not always possible to simplify program design by strictly managing the lifetimes of objects. If two objects have unpredictable lifetimes, but one of them needs to refer to the other, a simple ...
2
votes
3answers
112 views

Containers and lists

I want to create a container that has an AutoList object list. I wonder if my container is correct. ...
9
votes
1answer
236 views

Is my C++11 generic container a good design?

After refactors and refactors and the discovery of very common patterns on many of the classes of the software I wrote, I decided that it would be fine to have something like an arbitrary-keyed map, ...
8
votes
2answers
99 views

Container for list of ranges

I made a C++ container of an ordered list of integers, that, in order to save space, I save as ranges: For example, the list \$ \{1,2,3,5,6,7,8,9,20\} \$ is saved in memory as \$ \{(1,3), (5,9), ...
3
votes
1answer
79 views

Converting data when output std container via ostream_iterator

I have a strongly typed enum and std::vector of this type. ...
9
votes
1answer
177 views

Allowing user space file-system to (kind-of) keep more than maximum number of files open

The linked code below is meant to be used in a user space file-system (fuse). Given that multiple processes may have multiple files opened on the file-system, the files on the specific user space ...
5
votes
1answer
185 views

Simple sparse array

Today, I tried to create a really simple sparse_array container adapter. I did not provide all the STL-like functions, only the elementary ones as a proof of ...
2
votes
1answer
85 views

Bidirectional map based on memory manipulation

This is a bidirectional map implementation that stores the values as pairs on the heap, and uses pointer arithmetic for efficient lookup. codepad link, may be easier to read ...
4
votes
1answer
113 views

Boost multi-index based orderbook

As suggested here, I'm using Boost multi-index to implement orderbook. So far my code looks like this: "CommonsNative.h" contains ...
0
votes
1answer
92 views

Creating a singleton container class for intrer-class messaging

My question is for validation of my code (any loop holes / bugs) and guidance the best methodology to implement for my requirement. I am developing a Python application that will have many classes. ...
2
votes
1answer
344 views

vector<tuple<A,B> > to map<A,B>

i have an vector<tuple<A,b> > v and want to make a map<A,B> from it i came up with 3 variants: ...
2
votes
2answers
348 views

Need a suggestion for invert index structure in C++

I am trying to create an invert index structure in C++. An invert index, in this case, refers to image retrival system, where each invert index refers to a numbers of "Patch ID". (simply called "ID" ...
2
votes
2answers
361 views

Simple container class with templates

I've been working on a simple program to output values to the console as a learning project, and I stumbled across an article advising against using 2D containers, suggesting to simulate them instead ...
12
votes
2answers
730 views

O(1) lock free container?

I posted this code in answer to a question on SO and someone asked if it had been peer-reviewed. It had not so I thought you guys may be able to help. It is a lock-free ...