|
Boost : |
Subject: Re: [boost] RFC: A better shared_array
From: Olaf van der Spek (ml_at_[hidden])
Date: 2011-10-16 08:18:26
On Sun, Oct 16, 2011 at 4:57 AM, Rhys Ulerich <rhys.ulerich_at_[hidden]> wrote:
> Hi Olaf,
>
>> The current shared_array doesn't keep track of size. This greatly
>> decreases it's usefulness. So I wrote a variant that does:
>>
>> http://pastebin.com/wkdLVqM1
>
> I like the concept of combining a shared_array with an iterator_range.
> In my own work I can see an instance knowing its length, type
> erasure, and possibly providing custom deleter semantics being handy.
A custom deleter is supported already via shared_array2(T* b, T* e,
shared_ptr<void> const& n)
This would also allow you to construct a shared_array2 from a memory
mapped file, for example.
> I'd personally call it a shared_range.
Why?
The class owns the content. A range does not own the content.
Olaf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk