[#bsl-allocator_traits-0108-destroy] = xref:bsl.adoc[bsl]::xref:bsl/allocator_traits-0108.adoc[allocator_traits]::destroy :relfileprefix: ../../ :mrdocs: Destroy the object of (template parameter) type `ELEMENT_TYPE` at the specified `elementAddr`, either by 1) calling the `destroy` method on `basicAllocator` with `elemAddr` as the sole argument if the (template parameter) type `ALLOCATOR_TYPE` defines such a method, or 2) calling the destructor directly on `elementAddr` (and ignoring `basicAllocator`) otherwise. The behavior is undefined unless `elementAddr` refers to a valid, constructed object. == Synopsis Declared in `<bslma_allocatortraits.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ELEMENT_TYPE> static void destroy( ALLOCATOR_TYPE& basicAllocator, ELEMENT_TYPE* elementAddr); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#