File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 1515#ifndef LLVM_ADT_SCOPEEXIT_H
1616#define LLVM_ADT_SCOPEEXIT_H
1717
18- #include " llvm/Support/Compiler.h"
19-
20- #include < type_traits>
2118#include < utility>
2219
2320namespace llvm {
24- namespace detail {
2521
2622template <typename Callable> class scope_exit {
2723 Callable ExitFunction;
@@ -47,17 +43,15 @@ template <typename Callable> class scope_exit {
4743 }
4844};
4945
50- } // end namespace detail
46+ template < typename Callable> scope_exit (Callable) -> scope_exit<Callable>;
5147
5248// Keeps the callable object that is passed in, and execute it at the
5349// destruction of the returned object (usually at the scope exit where the
5450// returned object is kept).
5551//
5652// Interface is specified by p0052r2.
57- template <typename Callable>
58- [[nodiscard]] detail::scope_exit<std::decay_t <Callable>>
59- make_scope_exit (Callable &&F) {
60- return detail::scope_exit<std::decay_t <Callable>>(std::forward<Callable>(F));
53+ template <typename Callable> [[nodiscard]] auto make_scope_exit (Callable &&F) {
54+ return scope_exit (std::forward<Callable>(F));
6155}
6256
6357} // end namespace llvm
You can’t perform that action at this time.
0 commit comments