mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-01-19 17:46:46 +02:00
finally.hh: include works by itself; mark as nodiscard
This commit is contained in:
parent
bd21b4b134
commit
f6158ea53b
1 changed files with 3 additions and 1 deletions
|
@ -1,11 +1,13 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include <utility>
|
||||
|
||||
/**
|
||||
* A trivial class to run a function at the end of a scope.
|
||||
*/
|
||||
template<typename Fn>
|
||||
class Finally
|
||||
class [[nodiscard("Finally values must be used")]] Finally
|
||||
{
|
||||
private:
|
||||
Fn fun;
|
||||
|
|
Loading…
Reference in a new issue