Would you consider adding a header with some thin RAII wrappers to make using this library slightly easier? Here are a couple examples of what I'm thinking about:
class CPropValuePtr
{
public:
CPropValuePtr() :
m_p(NULL)
{
}
~CPropValuePtr()
{
Free();
}
LPSPropValue* operator&() noexcept
{
return &m_p;
}
LPSPropValue operator->() noexcept
{
return m_p;
}
void Free() noexcept
{
MAPIFreeBuffer(m_p);
m_p = NULL;
}
LPSPropValue m_p;
};
class CRowSetPtr
{
public:
CRowSetPtr() :
m_p(NULL)
{
}
~CRowSetPtr()
{
Free();
}
LPSRowSet* operator&() noexcept
{
return &m_p;
}
LPSRowSet operator->() noexcept
{
return m_p;
}
void Free() noexcept
{
FreeProws(m_p);
m_p = NULL;
}
LPSRowSet m_p;
};
Would you consider adding a header with some thin RAII wrappers to make using this library slightly easier? Here are a couple examples of what I'm thinking about: