|
Boost : |
Subject: Re: [boost] [Review] ITL review starts today, February 18th
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2010-03-05 15:25:33
Joachim Faulhaber wrote:
> 2010/2/28 Barend Gehrels <barend_at_[hidden]>:
> >
> > and then gives the example " mySet.contains(42)". But
> > contains is NOT an method of std::set, but YES from
> > interval_set. This was confusing.
>
> my view on sets here is not governed by std::sets but rather by the
> mathematical notion of a set or the itl::Set concept that is part of
> my documentation. In this view the "is element of" function is pretty
> fundamental and it is available for itl::interval_set and for itl::set
> as bool T::contains(const domain_type&);
[snip]
> Which is the common interface, the fundamental aspect, that
> constitutes this semantic kernel? Would that signature contain
> find(x)? Would it contain contains(x)? Would it provide iterators?
>
> boost::dynamic_bitset does not implement find, it does not implement
> iterators. Would we therefore say it is not a set? Its signature does
> not provide contains(x) but it contains test(x), which IMO should be
> called contains(x).
I'm speaking from partial ignorance, but...
Wouldn't it be better to use non-member functions for those operations expected of a set? Then, boost::dynamic_bitset would satisfy itl::contains(bitset, x) because it could be implemented in terms of test(). Likewise, std::set would satisfy because itl::contains(s, x) could be implemented in terms of find().
Using that approach, your concepts would apply to any type for which a specified set of non-member functions can be applied while meeting specific semantic requirements. I should think many more types could be adapted to ITL without needing specific support form ITL with that approach.
_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk