home.social

#shared_ptr — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #shared_ptr, aggregated by home.social.

fetched live
  1. I wonder if it'd work to add a guaranteed non-null pointer to C++ like this:

    gist.github.com/uliwitness/931

    #CPlusPlus #optionals #shared_ptr

    Update: The gist is now fully compiling code.

  2. 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.

    #cpp #std #shared_ptr