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
|
#pragma once
|
||||||
///@file
|
///@file
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A trivial class to run a function at the end of a scope.
|
* A trivial class to run a function at the end of a scope.
|
||||||
*/
|
*/
|
||||||
template<typename Fn>
|
template<typename Fn>
|
||||||
class Finally
|
class [[nodiscard("Finally values must be used")]] Finally
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
Fn fun;
|
Fn fun;
|
||||||
|
|
Loading…
Reference in a new issue