Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
559 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
3 votes
1 answer
975 views

Implementation of static_vector using an array of std::aligned_storage, with std::launder and forwarding

I'm trying to expand on the implementation of static_vector on the std::aligned_storage reference page, but would like to split it into two parts. First, an ...
rtek's user avatar
  • 53
8 votes
1 answer
123 views

Tracker for object construction, copy, and movement

I made an object tracker for debugging and testing purposes called ccm_counter (construction, copy, move counter). It counts constructor, copy and move calls. It ...
Timo's user avatar
  • 363
2 votes
1 answer
1k views

C++ - Trie Implementation

I am trying to learn trie and this is my first implementation. I started off with the idea of being able to handle different data types for key and value; however, I found the data structure a bit ...
skr's user avatar
  • 539
8 votes
2 answers
682 views

Custom fixed-space block memory allocator

This is a fixed-size memory allocator. The core memory block is an unsigned char pointer which gets allocated on initialization. Other than that, it has pretty basic allocation and block safety ...
mrsaturn110's user avatar
2 votes
1 answer
2k views

Fixed-size C++ object pool, contiguous storage, O(1) random access, alloc and free. One header-only

I have implemented a rather simple object pool for the sake of entities in my game world, and it works quite well. Advantages: Elements stay in contiguous memory - can be iterated just like in an ...
Patryk Czachurski's user avatar
2 votes
1 answer
517 views

C++ Policy-based object pool

Description This is an improved implementation for a previous post My goal was to implement a decent object pool using templates and policy based design. The object pool behaviour can be customized ...
amc176's user avatar
  • 345
6 votes
2 answers
5k views

Fixed size Memory Pool Implementation

Here is an attempt at implementing a fixed size Memory Pool1: pool.h ...
Ziezi's user avatar
  • 1,174
1 vote
1 answer
690 views

Template binary heap with lambda function comparator C++

This heap will be used for A* search pathfinding in my 2D isometric game engine. It uses lambda functions (instead of std::less or ...
TOM__'s user avatar
  • 105
10 votes
2 answers
3k views

C++ custom memory allocator

I'm working on a C++ custom memory allocator, that would be kind of a replacement for the C flexible array syntax, you know, the stuff like that: ...
Aleksey Demakov's user avatar
11 votes
1 answer
382 views

Wrapping types with alignment requirements

Visual Studio 2013 still doesn't support the alignas keyword in C++11. This causes some problems with alignment of types in various situations. Thankfully the ...
Emily L.'s user avatar
  • 16.6k
8 votes
2 answers
19k views

STL Stack Implementation

I implemented std::stack from the STL for deeper understanding of the language and memory since I still am only a beginner. I implemented the stack using a singly ...
Scholar's user avatar
  • 83
8 votes
1 answer
301 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 ...
jms's user avatar
  • 495