summaryrefslogtreecommitdiffstats
path: root/util.hpp
blob: 39749acc0ce54f9d4ff8793bf0f9fd97427f7484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <cstdlib>

namespace phosphor
{
namespace utility
{
/** @struct Free
 *  @brief A malloc cleanup type for use with smart pointers.
 */
template <typename T>
struct Free
{
    void operator()(T* ptr) const
    {
        free(ptr);
    }
};
} // namespace utility
} // namespace phosphor
// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
OpenPOWER on IntegriCloud