Open aprotyas opened 1 year ago
Something that's worked reasonably well for me so far...
struct SdlDeleter { void operator()(SDL_Window* window) { if (window != nullptr) { SDL_DestroyWindow(window); } } }; using WindowPtr = std::unique_ptr<SDL_Window, SdlDeleter>;
You might also want to talk about the incomplete struct pattern and why that prevents you from doing a simple std::unique_ptr<WindowPtr> approach.
std::unique_ptr<WindowPtr>
Something that's worked reasonably well for me so far...
You might also want to talk about the incomplete struct pattern and why that prevents you from doing a simple
std::unique_ptr<WindowPtr>
approach.