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

learn more… | top users | synonyms

8
votes
1answer
130 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, ...
0
votes
0answers
12 views

How to use the strategy pattern with STL containers? [migrated]

Assume that I have a strategy interface named BinaryClassifier that can take a Sample and return a ...
8
votes
2answers
78 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
61 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
164 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
84 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
60 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 ...
0
votes
1answer
73 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
180 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
308 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
3answers
291 views

Need advice with a simple container class with templates C++ (code layout and readability)

First of all, thanks for looking at this code. I'm a novice coder trying to learn C++ on my own so any help is much appreciated. I've been working on a simple program to output values to the console ...
11
votes
2answers
691 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 ...