Skip to main content

All Questions

5 votes
4 answers
2k views

StringPool in C++

I wrote a simple string pool for my compiler in C++ and want to hear your thoughts on its design. String pool has 2 functions: intern and ...
gavrilikhin.d's user avatar
4 votes
1 answer
117 views

Matrix template Class

This is my 2nd shot at dynamic memory allocation. This project is for practice purposes. So many things were considered whilst writing this minimal project. I considered using placement new to ...
theProgrammer's user avatar
3 votes
0 answers
159 views

Custom allocator for improved cache locality and fast iteration in C++

I am writing a custom allocator for my educational game engine project where I need to iterate through a collection of components(similar to Unity3D) every frame. There are game objects and every game ...
Vignesh Gunasekaran's user avatar
1 vote
1 answer
705 views

Fast insert, fast removal and fast access object pool C++ container

I just want to gather some feedback about this container, in my view it solves the problem of common data containers which don't have fast access and fast deletion. I want to admit that I have not ...
jokoon's user avatar
  • 293
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
2 votes
1 answer
823 views

Reconstructing Matrix scattered over many MPI ranks

I have a program that does some matrix computations using MPI (MPICH). Each rank has a slice of the matrix and does the computations on their slice to get a new slice of the matrix. Sometimes I need ...
nick's user avatar
  • 123
5 votes
1 answer
193 views

Block Allocation in Fixed-Size Block Allocator

The following routine is the block-allocation procedure in a fixed-size allocator being written for library use. It is designed to be accessed from C++ (the un-mangled symbol name is ...
Lux's user avatar
  • 153
4 votes
3 answers
5k views

Doubly Linked List Implementation [C++]

C++ noob reporting. I'm working on implementing a doubly linked list using two separate classes: one class, called node, containing your standard doubly linked list ...
cmt_'s user avatar
  • 41
9 votes
2 answers
6k views

Fast pool allocator for games in C++

I have implemented the following pool allocator in C++: ...
Peter Lenkefi's user avatar
3 votes
2 answers
1k views

Read numeric data from a text file using C++

I need to read Numeric Data from a text file that looks like this: 2 cell X-cord Y-cord 1 1.1 2.2 2 2.1 2.0 The first line indicates the dimension (...
Nerdrigo's user avatar
  • 131
9 votes
2 answers
1k views

C++ String class

I made a string class to be used as a replacement for std::string. It has all the find functions (find, ...
Dan Dan's user avatar
  • 633
2 votes
1 answer
903 views

Dynamic Array Bags

For one of my assignments, we were asked to create a data structure similar to Bags using dynamic arrays where the order would be important - which I was able to do successfully, that is, the code ...
Ayushya's user avatar
  • 123
21 votes
3 answers
9k views

A vector-like polymorphic container to store objects from a type hierarchy in contiguous memory

Normally, in order to have a polymorphic collection, we store pointers to a base class: ...
user2296177's user avatar
  • 3,543
6 votes
1 answer
561 views

Specialty tree structure - BK Tree

I've been working on a implementation of specialty tree structure called a BK-Tree (more here and here). Basically, it's a tree that allows relatively efficient querying for items within a specific ...
Fake Name's user avatar
  • 201
4 votes
3 answers
3k views

Creating number pattern (triangle numbers) in C++ with minimum loops

We were asked to make a triangular number pattern in C++ with minimum loops: ____1_____ ___2__3____ __4__5__6__ 7__8__9__10 Code: ...
Max Payne's user avatar
  • 359

15 30 50 per page