|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-05-14 15:13:01
"Neal D. Becker" <ndbecker2_at_[hidden]> writes:
> David Abrahams wrote:
>
>> "Neal D. Becker" <ndbecker2_at_[hidden]> writes:
>>
>>> Max Khesin wrote:
>>>
>>>>
>>>>> "Neal D. Becker" <ndbecker2_at_[hidden]> writes:
>>>>
>>>> Good suggestion! I'll post the modified code if anyone is interested.
>>>>
>>>>
>>>>
>>>> Yes pleaze.
>>>
>>> Here is the current version:
>>
>> distance_to doesn't belong here, and you can eliminate the
>> corresponding cnt.
>>
>
> Actually, I like the one based on Vladimir Prus much better than the one I
> wrote, so here is the current:
I don't love it. Count is overkill; you only need a bool. Also it
only works when value_type is default-constructible. There's a
reason I suggested optional<value_type>, you know ;-)
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk