Is there a `std ::` libdispatch equivalent of `dispatch_data_t`?

I love you dispatch_data_t. It provides a useful abstraction at the top of the memory range: it provides reference counting, allows consumers to create arbitrary subbands (which are involved in the ref count of the parent range), concatenation of the subbands, etc. (I won 'feel free to look into the details - the documents are right here: Managing send data objects )

I tried to find out if there is a C ++ 11 equivalent, but the terms “range”, “memory” and “reference counting” are pretty general, which makes Google search too complicated. I suspect someone who spends more time with the standard C ++ library than I can know from my head.

Yes, I know that I can use the API dispatch_data_tfrom C ++ code, and yes, I know that it’s easy to scroll through the naive implementation of the first pass of such a thing, but I'm specifically looking for something idiomatic for C ++, and with high gloss / reliability. (May be?)

+4
source share
1 answer

No.

Representation of ranges is offered for future standard versions, but they do not own.

dispatch_data_tstrongly tied to GCD, since cleaning takes place in a given queue defined at creation: to duplicate this behavior, we need thread pools and queues in stdwhich we do not have.

, . , , - ( /?), utlities ( ), - rc 1 .

-, , boost, . , , - .

, boost.

+4

Source: https://habr.com/ru/post/1534449/


All Articles