|
Boost : |
Subject: Re: [boost] [review] The review of Boost.DoubleEnded starts today: September 21 - September 30
From: Daniel James (dnljms_at_[hidden])
Date: 2017-09-26 23:08:59
On 26 September 2017 at 22:20, Tim Song via Boost <boost_at_[hidden]> wrote:
> On Tue, Sep 26, 2017 at 5:06 PM, Benedek Thaler via Boost
> <boost_at_[hidden]> wrote:
>> On Tue, Sep 26, 2017 at 2:43 AM, Tim Song via Boost <boost_at_[hidden]>
>> wrote:;
>>>
>>> Why are pointers being used as iterator types directly?
>>>
>>
>> To keep simple things simple. What's wrong with pointers?
>>
>
> Using pointers directly makes it easier to write buggy code. A custom
> iterator type, even if just a thin wrapper, provides more type safety.
That's a pretty slim advantage, I'd value simplicity more. It's very
much a judgement call.
>>> More generally, implementation of allocator support requires
>>> substantial improvement. An allocator that doesn't propagate on X is
>>> not required to support X at all, but there's no handling for that in
>>> your code. Another example: construct takes raw pointers, not
>>> possibly fancy `pointer` like what you did here:
>>> https://github.com/erenon/double_ended/blob/master/
>>> include/boost/double_ended/devector.hpp#L2086
>>>
>>>
>> `pointer` is defined by allocator_traits. Couldn't that be a fancy pointer,
>> if the Allocator defines it so?
>
> allocate/deallocate use (possibly fancy) `pointer`.
> construct/destroy always use raw pointers, never fancy pointers.
The allocator support is pretty bad, but that's fixable and doesn't
reflect on the design of the containers. It's specialist knowledge,
and it's not that long since most (or even all?) standard libraries
made a pig's ear of it. I can help improve the allocator support if
wanted.<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
<tr>
<td style="width: 55px; padding-top: 13px;"><a
href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"
target="_blank"><img
src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif"
alt="" width="46" height="29" style="width: 46px; height: 29px;"
/></a></td>
<td style="width: 470px; padding-top: 12px; color: #41424e;
font-size: 13px; font-family: Arial, Helvetica, sans-serif;
line-height: 18px;">Virus-free. <a
href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"
target="_blank" style="color: #4453ea;">www.avast.com</a>
</td>
</tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1"
height="1"></a></div>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk