Skip to content

Commit

Permalink
Merge pull request #1154 from lairworks/sdlStringDeleterLambda
Browse files Browse the repository at this point in the history
Use a lambda expression for custom deleter `SdlStringDeleter`
  • Loading branch information
DanRStevens authored Apr 28, 2024
2 parents 121411e + 5c1e656 commit a1101f6
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 a1101f6

Please sign in to comment.