[#BloombergLP-bslma-RawDeleterGuard]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::RawDeleterGuard
:relfileprefix: ../../
:mrdocs:

This class implements a guard that unconditionally deletes a managed object upon destruction by first invoking the object&apos;s destructor, and then invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction&period; The managed object of parameterized `TYPE` must have been created using memory provided by this allocator (or pool), which must remain valid throughout the lifetime of the guard object&period;

== Synopsis

Declared in `&lt;bslma&lowbar;rawdeleterguard&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TYPE,
    class ALLOCATOR&gt;
class RawDeleterGuard;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/RawDeleterGuard/2constructor.adoc[`RawDeleterGuard`]         [.small]#[constructor]#
| Create a raw deleter guard that unconditionally manages the specified `object`, and that uses the specified `allocator` to delete `object` upon the destruction of this guard&period; The behavior is undefined unless `object` and `allocator` are non&hyphen;zero, and `allocator` supplied the memory for `object`&period; Note that `allocator` must remain valid throughout the lifetime of this guard&period;
| xref:BloombergLP/bslma/RawDeleterGuard/2destructor.adoc[`&#126;RawDeleterGuard`] [.small]#[destructor]#
| Destroy this raw deleter guard and delete the object it manages by first invoking the destructor of the (managed) object, and then invoking the `deallocate` method of the allocator (or pool) that was supplied with the object at construction&period;
|===



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