
18 May
2008
18 May
'08
9:04 p.m.
Hi! Kevin Martin schrieb:
A layer of abstraction between the library calls and your user code.
Right. A layer of abstraction. That's just what I have: my abstraction does not expose any database header. Everything is hidden in a pimpl. But how shall I implement the pimpl? It needs to "own" a database connection. I could write a destructor that closes the connection. But I don't bother. I try to avoid writing any destructor. I stick to existant RAII classes. So I use a shared_ptr with a custom deleter that closes the connection. Feels safe. That's what I gain. :) Regards, Frank