1 /* 2 (c) 2014 Glen Joseph Fernandes 3 glenjofe at gmail dot com 4 5 Distributed under the Boost Software 6 License, Version 1.0. 7 http://boost.org/LICENSE_1_0.txt 8 */ 9 #ifndef BOOST_ALIGN_ALIGNED_DELETE_HPP 10 #define BOOST_ALIGN_ALIGNED_DELETE_HPP 11 12 #include <boost/config.hpp> 13 #include <boost/align/aligned_alloc.hpp> 14 #include <boost/align/aligned_delete_forward.hpp> 15 16 namespace boost { 17 namespace alignment { 18 19 class aligned_delete { 20 public: 21 template<class T> operator ()(T * ptr) const22 void operator()(T* ptr) const 23 BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(ptr->~T())) { 24 if (ptr) { 25 ptr->~T(); 26 alignment::aligned_free(ptr); 27 } 28 } 29 }; 30 31 } /* :alignment */ 32 } /* :boost */ 33 34 #endif 35