#shared_ptr — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #shared_ptr, aggregated by home.social.
-
I wonder if it'd work to add a guaranteed non-null pointer to C++ like this:
https://gist.github.com/uliwitness/931873c0b2edaa537b905418a024be04
#CPlusPlus #optionals #shared_ptr
Update: The gist is now fully compiling code.
-
TIL that std::shared_ptr has a custom "deleter" function you can set for actually deleting the memory. Seems to make for a pretty nice way to create a memory buffer manager. I need to shuffle a lot of smallish buffers and allocating/freeing memory all the time is not particularly efficient, especially not when time is essential. I guess this is nothing new to the veterans out there, but it'll make my life easier.