From: "Jim Grandy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Peter Dimov" <[EMAIL PROTECTED]>

> One thing missing from intrusive_ptr as implemented in 1.29 is the ability
> to avoid the add_ref at construction time.
>
> There are a number of APIs using refcounted opaque types (Apple in
> particular is fond of them) in which a function call will "pre-acquire" a
> reference for the caller. In many OS X APIs, this is designated by use of
> the term "Copy" or "Create" instead of "Get". If you think about it,
adding
> a ref before returning is necessary for flat C APIs to avoid thread
> synchronization problems.

[...]

> This would allow one to use this style of code:
>
>     intrusive_ptr<OpaqueRefCountedString> s =
>         dont_addref(CopyMenuTitle(m));

intrusive_ptr<OpaqueRefCountedString> s = CopyMenuTitle(m);
s->Release(); // or however it's spelled

?

BTW, there is no boost-request list, I think. :-)

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to