quick_exit
ILogger *l
as is, is it common practice?ILogger *l
as is, is it common practice? std::unique_ptr
, sometimes as std::shared_ptr
and sometimes as raw pointerstd::shared_ptr
, there’s no changing your mind. Even if the reference count is one, you can’t reclaim ownership of the resource in order to, say, have a std::unique_ptr
manage it.std::shared_ptr
str_copy
to not produce invalid UTF-8struct SDLWindowDestroyer
{
void operator()(SDL_Window* w) const
{
SDL_DestroyWindow(w);
}
};
std::unique_ptr<SDL_Window, SDLWindowDestroyer> window_;
operator()
in our source