Skip to main content

All Questions

0 votes
0 answers
31 views

Presence of UB and memory usage of a std::array initialization: version with temporary array on heap

I proposed several techniques to answer to https://stackoverflow.com/q/78672409/21691539. A classical way to answer would be to use std::index_sequence-based ...
Oersted's user avatar
  • 337
3 votes
1 answer
221 views

Presence of UB and memory usage of a std::array initialization

I proposed several techniques to answer to https://stackoverflow.com/q/78672409/21691539. A classical way to answer would be to use std::index_sequence-based ...
Oersted's user avatar
  • 337
2 votes
0 answers
48 views

Reusable storage for array of objects V4

Here is a thirdfollow up on Reusable storage for array of objects, Reusable storage for array of objects V2 and Reusable storage for array of objects V3, taking into account the provided answers. The ...
Oersted's user avatar
  • 337
1 vote
1 answer
48 views

Reusable storage for array of objects V3

Here is a second follow up on Reusable storage for array of objects and Reusable storage for array of objects V2, taking into account the provided answers. The following code should be compliant at ...
Oersted's user avatar
  • 337
3 votes
1 answer
66 views

Reusable storage for array of objects V2

Here is a follow up on Reusable storage for array of objects, taking into account the provided answers. The following code should be compliant at least with gcc, <...
Oersted's user avatar
  • 337
4 votes
2 answers
487 views

Reusable storage for array of objects

My goal is to have a memory pool non-template class that is used to store arrays of objects. The same memory pool object must be reusable for a different array (difference size, different type and/or ...
Oersted's user avatar
  • 337
6 votes
3 answers
2k views

Dynamic array implementation using C++

I implemented a basic dynamic array using C++. When deleting an element and shifting the others, the last element will be twice repeated (the original still exists after copying). I want to avoid ...
Youssef Refaat's user avatar
2 votes
1 answer
134 views

A heap-allocated texture class for a console renderer

I am working on a console renderer and I want a heap-allocated dynamic texture class. Since I am quite new to C++, I just want to check the memory management, if I destroy all pointers correctly etc. ...
Jacob's user avatar
  • 43
8 votes
1 answer
833 views

A fixed-size dynamic array

Background I implemented the historic std::dynarray according to the specification under the name dynamic_array in C++17. ...
L. F.'s user avatar
  • 9,570
5 votes
2 answers
1k views

A static array implementation in C++

I'm implementing a basic array data structure with basic functionalities. ...
Bilal Ahmed's user avatar
2 votes
0 answers
50 views

Fixed Size Resource Array with Versioned Indexes

I'm trying to implement a fixed sized array that uses versioned keys for dangling safety. This structure is similar to a slot map data structure, with the exception that this does not automatically ...
rtek's user avatar
  • 53
1 vote
3 answers
470 views

Memory management for matrices built with dynamic arrays

I am working on C++ code which builds matrices (3D and 4D) using dynamic arrays. I am using arrays instead of std::vector; as in the future, I might extend this ...
hydecpp's user avatar
  • 19
1 vote
2 answers
4k views

Perlin Noise Generator

I'm porting a 2-D Terrain Generator from Python to C++ as Python is too slow due to the number of features that have been added. I'm new to C++ and would like to know of any criticisms that you can ...
user avatar
2 votes
1 answer
190 views

Helper class for accessing blobs and mmap memory

This class was inspired from Microsoft's array_view. It intended to use with mmap-ed memory for easily check bounds and so on. ...
Nick's user avatar
  • 1,582
7 votes
4 answers
5k views

Simple resizable array

In some (lower-level) parts of my codebase I often have the need to allocate resizable array storage for certain objects, that usually are not default-constructible. I created a simple class using <...
Vittorio Romeo's user avatar