[#absl-MakeCleanup]
= xref:absl.adoc[absl]::MakeCleanup
:relfileprefix: ../
:mrdocs:

Create an `absl&colon;&colon;Cleanup` from a callback&period;

== Synopsis

Declared in `&lt;absl&sol;cleanup&sol;cleanup&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename&period;&period;&period; Args,
    typename Callback&gt;
xref:absl/Cleanup-0a.adoc[absl::Cleanup&lt;cleanup&lowbar;internal::Tag, Callback&gt;]
MakeCleanup(Callback callback);
----

== Description

C&plus;&plus;11 type deduction API for creating an instance of `absl&colon;&colon;Cleanup`, e&period;g&period; `auto c &equals; absl&colon;&colon;MakeCleanup(&sol;&ast; callback &ast;&sol;)&semi;`&period;

== Return Value

A `Cleanup` guard owning `callback`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *callback*
| The callable to invoke when the guard is destroyed&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
