1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 23:03:53 -04:00

finally.hh: include works by itself; mark as nodiscard

This commit is contained in:
Jade Lovelace 2024-02-26 00:30:51 -08:00
parent bd21b4b134
commit f6158ea53b

View file

@ -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;