Sentinels in collections, was RE: Primitive Queue<any T> considerations

Vitaly Davidovich vitalyd at gmail.com
Wed Nov 18 23:31:37 UTC 2015


I'm still unclear on how we ended up discussing internal sentinels that are
effectively implementation details.  I don't think there's any debate on
this part.

I do, however, disagree on sentinels that leak out of the implementation
and require user to select a magic number.  And I say this as someone who
constantly exploits domain specific constraints on values to optimize
code.  In particular, in a world where optional<value_type> is cheap asking
user to declare a magic number is unfortunate; this is required today, but
it's a language limitation.  I'd hate to have that perpetuated once better
language features are available.

sent from my phone
On Nov 18, 2015 6:19 PM, "Richard Warburton" <richard.warburton at gmail.com>
wrote:

> Hi,
>
> Agreed, so maybe I misinterpreted Richard’s email (I tried to mitigate by
>> changing the subject). Richard, which type of sentinel did you mean?
>>
>
> Well I was originally thinking in terms of the Queue interface itself,
> which needed a sentinel taken out of the user's domain. I don't think its a
> problem to expand the discussion though and you're certainly right to
> observe that there are two different kinds of sentinel.
>
> regards,
>
>   Richard Warburton
>
>   http://insightfullogic.com
>   @RichardWarburto <http://twitter.com/richardwarburto>
>



More information about the valhalla-dev mailing list