Derecho  0.9
Distributed systems toolkit for RDMA
context_ptr.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <memory>
3 #include <type_traits>
4 
5 namespace mutils{
6 
7  template<typename T>
8  struct ContextDeleter : public std::conditional_t<std::is_pod<T>::value,
9  ContextDeleter<void>,
10  std::default_delete<T> > {
11  };
12 
13  template<>
14  struct ContextDeleter<void> {
15  void operator()(...){}
16  };
17 
18 
19  template<typename T>
20  using context_ptr = std::unique_ptr<T,ContextDeleter<T> >;
21 
22 }
std::unique_ptr< T, ContextDeleter< T > > context_ptr
Definition: context_ptr.hpp:20
Definition: Bytes.hpp:5