Files
externals/linux/include/ActivBoost/align/aligned_delete.hpp
T
2023-12-15 13:15:08 -05:00

32 lines
705 B
C++

/*
Copyright 2014-2015 Glen Joseph Fernandes
(glenjofe@gmail.com)
Distributed under the Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef ACTIV_BOOST_ALIGN_ALIGNED_DELETE_HPP
#define ACTIV_BOOST_ALIGN_ALIGNED_DELETE_HPP
#include <ActivBoost/align/aligned_alloc.hpp>
#include <ActivBoost/align/aligned_delete_forward.hpp>
namespace Boost {
namespace alignment {
struct aligned_delete {
template<class T>
void operator()(T* ptr) const
ACTIV_BOOST_NOEXCEPT_IF(ACTIV_BOOST_NOEXCEPT_EXPR(ptr->~T())) {
if (ptr) {
ptr->~T();
Boost::alignment::aligned_free(ptr);
}
}
};
} /* alignment */
} /* boost */
#endif