$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [mem_fn] Ambiguous call to mem_fn with stdcallfunction
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-03-07 12:23:05
Conrad Scott:
...
> void test_mem_fn(IDirect3DDevice9 * const device)
> {
> boost::shared_ptr<IDirect3DDevice9> ptr(
> device,
> boost::mem_fn(&IDirect3DDevice9::Release) );
> }
There's also the option of using
struct com_deleter
{
template<class T> void operator()(T* p) const
{
p->Release();
}
};
void test(IDirect3DDevice9 * const device)
{
boost::shared_ptr<IDirect3DDevice9> ptr(
device,
com_deleter() );
}