ATLAS Offline Software
TDestructor.icc
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: TDestructor.icc 599775 2014-06-01 16:20:52Z krasznaa $
8 #ifndef XAODROOTACCESS_TOOLS_TDESTRUCTOR_ICC
9 #define XAODROOTACCESS_TOOLS_TDESTRUCTOR_ICC
10 
11 namespace xAOD {
12 
13  /// The function just assumes that the pointer given to it is a valid
14  /// pointer of type T, and deletes the object behind the pointer accordingly.
15  ///
16  /// @param ptr A pointer to an object of type T
17  ///
18  template< class T >
19  void TDestructor< T >::destruct( void* ptr ) const {
20 
21  // Do a forceful cast:
22  T* p = reinterpret_cast< T* >( ptr );
23  // And now delete the object:
24  delete p;
25 
26  return;
27  }
28 
29 } // namespace xAOD
30 
31 #endif // XAODROOTACCESS_TOOLS_TDESTRUCTOR_ICC