ATLAS Offline Software
Loading...
Searching...
No Matches
deleter.h
Go to the documentation of this file.
1#ifndef EVENTCONTAINERS_DELETER_H
2//#define EVENTCONTAINERS_DELETER_H
3#include <bit>
4
5#if 0
6 struct deleter
7 {
8 void operator() (const void* p);
9 };
10#endif
11
12
13 typedef void deleter_f (const void* p);
14
16 : public std::unique_ptr<const void, deleter_f*>
17 {
18 public:
19 using std::unique_ptr<const void, deleter_f*>::unique_ptr;
20
21 template <class T>
22 struct Deleter
23 {
24 static void deleter (const void* p)
25 {
26 delete std::bit_cast<const T*>(p);
27 }
28 };
29
30 template <class T>
31 void_unique_ptr(std::unique_ptr<T> p)
32 : std::unique_ptr<const void, deleter_f*> (p.release(),
33 Deleter<T>::deleter)
34 {
35 }
36 };
37
38#endif
STL class.
void_unique_ptr(std::unique_ptr< T > p)
Definition deleter.h:31
static std::string release
Definition computils.h:50
void deleter_f(const void *p)
Definition deleter.h:13
STL namespace.
static void deleter(const void *p)
Definition deleter.h:24