All Questions
56
questions
0
votes
1
answer
545
views
Count the number of objects created statically and dynamically in C++
I have written below program to count the number of static and dynamically created object of the class.
...
6
votes
1
answer
339
views
Safe new/delete
A student was having problems with memory management so I put together an overload of global operator new and global ...
5
votes
0
answers
1k
views
Polymorphic deleter for unique_ptr
There is a basic difference in the way C++ manages the deleter for std::unique_ptr and std::shared_ptr, mainly for allowing ...
1
vote
1
answer
131
views
Boolean class using shared referenced memory
To improve my knowledge I am trying to make a bool class from scratch, or derivative of. I am using MinGW g++11 compiler on a Windows 7 laptop.
...
5
votes
1
answer
1k
views
C++ shared_ptr memory pool
I put together this little memory pool class to help avoid the costs associated with heap allocation and deallocation of objects that are frequently created & destroyed. It creates C++ standard <...
2
votes
0
answers
319
views
Yet Another Non-Intrusive Reference Counted Smart Pointer Implementation
I needed a reference counted smart pointer for my project, and for some reason early in my project, I decided that I did not like the std::shared_ptr. I can't ...
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 ...
9
votes
2
answers
6k
views
Fast pool allocator for games in C++
I have implemented the following pool allocator in C++:
...
3
votes
0
answers
320
views
C++ object pool using C memory pool as base
I started out with this question on Stack Overflow. I have since then gotten an official answer from the mbed developers that the MemoryPool that I was asking about only issued raw C malloc/free type ...
2
votes
1
answer
514
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 ...
13
votes
1
answer
3k
views
C++ class for aligning objects on the stack
I wrote a short class which allocates objects on the stack and aligns them to a specific memory address. Alignment makes sense for some objects (i.e. some SIMD intrinsics require aligned data). I ...
6
votes
2
answers
16k
views
C++ Trie using std::map and std::unique_ptr
I'm learning C++ and whilst trying to write in modern C++, I've made an attempt to rewrite a trie implementation written in C found here: http://www.geeksforgeeks.org/trie-insert-and-search/
It uses ...
2
votes
2
answers
989
views
A simple C++ Trie for working with strings
Here is a simple C++ 11 trie for insertion and membership testing:
...
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.
...
13
votes
2
answers
920
views
Dynamic memory management for a class hierarchy of geometric shapes
The task was to write function that compare areas of two random generated geometric shapes (circle, square, rectangle) using base class with virtual function.
Am I doing it right in terms of memory ...