python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Why is shared_ptr implemented using control block and not a static map?
To me, it looks like an implementation of std::shared_ptr which stores a reference counter in a static std::unordered_map<void*, struct Counters> would be much more simpler and also allow us to ...
i cant
Votes: 0
Answers: 1
CPP: Is this a reasonable way to go about thread safe FIFIO message queues
Please be gentle - first time I've posted here. Currently teaching myself C++. Wanted to play with threads and passing messages of any type between them. Not got to the thread part yet - just worki...
N Oncore
Votes: 0
Answers: 1
How does use of make_unique prevent memory-leak, in C++?
fn(unique_ptr<A>{new A{}},unique_ptr<B>{new B{}});
is troublesome as A or B gets leaked if an exception is thrown there.
fn(make_unique<A>(),make_unique<B>());
on the other h...

Supreeto
Votes: 0
Answers: 1
Hash function for a smart pointer class as key for an unordered map
So, I have a pointer wrapper class which stores only a pointer and I need to use this class instance as a key in an unordered map. I currently have a similar setup with this pointer wrapper instances ...
Xero
Votes: 0
Answers: 1