C
CFG
I need a class similar to shared_ptr<> but without pointer semantics.
The class should implement thread-safe reference counting
and custom deleter to be call when RefCount==0
Examples:
shared_resource<HGDIOBJ> a(hBrush, :eleteObject);
shared_resource<HANDLE> a(hHandle, ::CloseHandle);
shared_resource<int> a(iFileHandleCRT, ::close);
Any hints?
The class should implement thread-safe reference counting
and custom deleter to be call when RefCount==0
Examples:
shared_resource<HGDIOBJ> a(hBrush, :eleteObject);
shared_resource<HANDLE> a(hHandle, ::CloseHandle);
shared_resource<int> a(iFileHandleCRT, ::close);
Any hints?