RESTinio
at_scope_exit.hpp
Go to the documentation of this file.
1/*
2 * SObjectizer-5, RESTinio
3 */
4
17#pragma once
18
19#include <utility>
20
21namespace restinio {
22
23namespace utils {
24
25namespace scope_exit_details {
26
30template< typename L >
32 {
34 public :
35 at_exit_t( L && l ) : m_lambda{ std::forward<L>(l) } {}
38 };
39
40} /* namespace scope_exit_details */
41
58template< typename L >
59scope_exit_details::at_exit_t< L >
61 {
62 return scope_exit_details::at_exit_t<L>{ std::forward<L>(l) };
63 }
64
65} /* namespace utils */
66
67} /* namespace restinio */
68
Helper class for scope exit implementation.
scope_exit_details::at_exit_t< L > at_scope_exit(L &&l)
Helper function for creation action to be performed at scope exit.
STL namespace.