Skip to main content

All Questions

0 votes
1 answer
554 views

Vector Implementation C++ using RAII

I have attempted to implement a similar version of the STL Vector; several functions are missing but I'd like a few words of advice on whether I am indeed on the right track or whether I should change ...
PeePeePooPoo's user avatar
4 votes
1 answer
277 views

C++ Dynamic Array Class Testing

I'm creating a basic Dynamic Array class in C++, and I'd like to know if there are any bugs/memory leaks I haven't noticed yet. dyn_arr.h : ...
DarkoNaito_09's user avatar
2 votes
1 answer
203 views

dumb::vector - a class for students to use when they are expressly forbidden from using std::vector

I have created a small library for use by beginner C++ students who are forbidden from using std::vector in their projects. Because of this, I would like you to ...
JohnFilleau's user avatar
4 votes
3 answers
1k views

Fast-resizing uint8 buffer

I wanted a buffer like std::vector<uint8_t> which is very fast at resizing, and it does not require byte initialization (it resizes to 16K, then to 2-4 bytes, ...
hanshenrik's user avatar
28 votes
5 answers
5k views

C++ Vector Clone

I'm learning C++, so I decided to make a simpler clone of std::vector. Concerns: I have seen people defining methods outside of the class, and only prototyping ...
internet_user's user avatar
2 votes
1 answer
9k views

Vector with move constructor and move assignment operator [closed]

Please verify whether the code for a move constructor and a move assignment operator is correct. ...
ankit srivastava's user avatar
7 votes
2 answers
2k views

Fast variable-length stack allocator for vector<> in C++

I wrote a variable-length stack allocator for the vector<> class in C++ 11. In order to be able to allocate size dynamically at runtime I made use of the non-...
MathuSum Mut's user avatar
2 votes
2 answers
2k views

Simple class to mimic a dynamic array

for my c++ class I was asked to write a class with the following characteristics: Implement a vector replacement that operates only on integers (you don't need to use templates like the normal STL)...
Obito's user avatar
  • 23
2 votes
2 answers
2k views

Using std::vectors to store textures

I need to write a TextureManager class which stores Texture objects; the problem is I'm using an ...
MattMatt's user avatar
  • 593
6 votes
2 answers
520 views

Vector backed by memory pages

The purpose of this class is to wrap a std::vector in a class so that never a new object is added. We don't allocate a new object on the stack but we trying to fit ...
lezebulon's user avatar
  • 161
6 votes
4 answers
41k views

Creating a custom Vector class

I'm new to C++ and am doing the C++ 4th Edition Stroustrup book. I expanded on one of the examples, and have a few questions to ask (embedded within the code: ////QUESTION 1-9). Please provide any ...
Jhomas Tefferson's user avatar
2 votes
2 answers
2k views

split string into container on char; efficiently?

Here is my single parse code for splitting a std::string on a char into a ...
A T's user avatar
  • 485
7 votes
2 answers
22k views

Template vector class

I am trying to implement a vector-like container of my own (just to gain a better understanding of how std::vector works under the hood). I've been using this as a ...
Anmol Singh Jaggi's user avatar
4 votes
4 answers
2k views

Reducing memory usage of nested vectors

I recently asked this question about performance of an unordered_map, but I realize my question is probably more about this piece of code here. I create a 8 x 10 x 30 x 30 x 24000 nested vectors of ...
user avatar