Skip to content

Commit

Permalink
Fix scope guard
Browse files Browse the repository at this point in the history
  • Loading branch information
Sirraide committed Jul 22, 2023
1 parent ff04bda commit 0923bca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/clopts.hh
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static file_data_type map_file(
/// Read the file manually.
auto f = std::fopen(path.data(), "rb");
if (not f) return err(path);
at_scope_exit _close_file = [&] { std::fclose(f); };
at_scope_exit<decltype([&] { std::fclose(f); })> _close_file;

/// Get the file size.
std::fseek(f, 0, SEEK_END);
Expand Down

0 comments on commit 0923bca

Please sign in to comment.