summaryrefslogtreecommitdiff
path: root/ADBC/adbc/destroy_t.h
blob: 0e7c2f1cfef64f25196955e4727bf130072216fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// -*- C++ -*-

//=============================================================================
/**
 * @file      destroy_t.h
 *
 * $Id$
 *
 * @author    James H. Hill
 */
//=============================================================================

#ifndef _ADBC_DESTROY_T_H_
#define _ADBC_DESTROY_T_H_

namespace ADBC
{
/**
 * @struct destroy_t
 *
 * Functor for calling the destroy function of a pointer.
 */
template <typename T>
struct destroy_t
{
  /// Type definition of the pointer's type.
  typedef T type;

  void operator () (T * ptr) const
  {
    ptr->destroy ();
  }
};
}

#endif  // !defined _ADBC_DESTORY_T_H_