Skip to content

Commit

Permalink
Use a lambda expression for the custom deleter
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRStevens committed Apr 18, 2024
1 parent 121411e commit 5c1e656
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions NAS2D/Filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,7 @@ using namespace NAS2D;

namespace
{
struct SdlStringDeleter
{
void operator()(char* string)
{
SDL_free(string);
}
};


using SdlStringDeleter = decltype([](char* string) { SDL_free(string); });
using SdlString = std::unique_ptr<char, SdlStringDeleter>;


Expand Down

0 comments on commit 5c1e656

Please sign in to comment.