pacemaker 1.0.1
COM automation for people with deadlines and a hatred of GUIs
 
Loading...
Searching...
No Matches
unique_com_ptr.hpp
Go to the documentation of this file.
1#ifndef PACEMAKER_INCA_DETAIL_UNIQUE_COM_PTR_HPP_
2#define PACEMAKER_INCA_DETAIL_UNIQUE_COM_PTR_HPP_
3
4#include <memory>
5
7{
17 template<class T>
19 {
28 void operator()(T *ptr)
29 {
30 if (ptr == nullptr) return;
31 ptr->Release();
32 }
33 };
34
54 template<class T>
55 using unique_com_ptr = std::unique_ptr<T, ComObjDeleter<T>>;
56
57}; // namespace pacemaker::inca::detail
58
59#endif // PACEMAKER_INCA_DETAIL_UNIQUE_COM_PTR_HPP_
std::unique_ptr< T, ComObjDeleter< T > > unique_com_ptr
RAII owning pointer for COM objects.
Custom deleter for COM objects.
void operator()(T *ptr)
Release the COM object.