Boost logo

Boost :

Subject: Re: [boost] [review] The review of Boost.DoubleEnded starts today: September 21 - September 30
From: Thorsten Ottosen (tottosen_at_[hidden])
Date: 2017-09-27 18:25:59


Den 27-09-2017 kl. 01:08 skrev Daniel James via Boost:
> 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.
>

I think Boost.Container uses a simple wrapper around T*, but at the same
time has a macro that can be defined to turn it into pointers again.

I would expect that some code does things differently if they are passed
two pointers instead of two iterators.

kind regards

Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk