1 /*
2 Copyright 2014-2015 Glen Joseph Fernandes
3 ([email protected])
4 
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
7 */
8 #ifndef BOOST_ALIGN_ALIGNED_DELETE_HPP
9 #define BOOST_ALIGN_ALIGNED_DELETE_HPP
10 
11 #include <boost/align/aligned_alloc.hpp>
12 #include <boost/align/aligned_delete_forward.hpp>
13 
14 namespace boost {
15 namespace alignment {
16 
17 struct aligned_delete {
18     template<class T>
operator ()boost::alignment::aligned_delete19     void operator()(T* ptr) const
20         BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(ptr->~T())) {
21         if (ptr) {
22             ptr->~T();
23             boost::alignment::aligned_free(ptr);
24         }
25     }
26 };
27 
28 } /* alignment */
29 } /* boost */
30 
31 #endif
32