From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2006-12-01 16:21:06
Sohail Somani wrote:
> I don't particularly like requiring implicit function declarations. I'd
> rather tie them to the resource pointer type somehow. That's just my own
> preference which may or may not be totally wrong (but its not). I think
> its too easy for people to forget to do it. I prefer parameterized type
> + typedef.
My view on the issue is, that if a designer follows RAII (or should I say
RRID) there is no need for such a thing. So I don't see why third-party
issues should affect our interfaces. Anyway, I don't have too strong of
an opinion about it.
>>>The only other option is using a type erasure mechanism
>>>like shared_ptr which
>>>is more trouble than its worth for things like deallocating
>>I was referring to the file pointer, which is pretty much the
>>only "C resource" I use.
>>You're right when it comes to malloc/free, of course - but do
>>we really need it?
> Anytime you deal with C atleast, the answer is yes.
I doubt it's good practice for a C library to allocate stuff and hand it
to the user who has to then free it or to free stuff that comes from the
The other cases are:
a) it's up to the user to obtain the memory, so new/delete will work
b) the library provides ctor/dtor routines, so custom deleters are needed
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk