Boost logo

Boost :

From: jhrwalter (walter_at_[hidden])
Date: 2002-03-14 05:16:00


--- In boost_at_y..., Kresimir Fresl <fresl_at_g...> wrote:
>
> jhrwalter wrote:
>
> > May be upper_bound()/lower_bound() are bad names.
>
> It seems that they are. At least, they are misleading.
>
> > These member are essential for the iterators of binary operation
> > expression templates: [...]
>
> I think (hope) that I see what you mean: if
> ---------------------------------------------------------------
> numerics::unit_vector<double> u3 (8, 3);
> numerics::unit_vector<double> u4 (8, 5);
>
> cout << (u3+u4).begin().index() << " "
> << (u3+u4).end().index() << endl;
> ----------------------------------------------------------------
> is compiled with -DNDEBUG (which on g++ means
> `use expression templates'), the output is: `3 6',
> and when NDEBUG is not defined (ie., `don't use ETs'),
> output is `0 8'.

Correct, that's the intended behaviour ;-)
 
> > OTOH do you know a better name for the existing beasts?
> > [lower_bound()/upper_bound()]
>
> Hmm. Maybe simply `first()' and `last()'?

Ok, I'll change them to find_first()/find_last(), if you agree.
 
> >>[2] `find()', `lower_bound()' and `upper_bound()' are listed
> >>in interface of `numerics::vector<>' in docs, but I didn't find
> >>their description (AFAIK functions `find()' etc. are described
> >>only in docs for `compressed_array<>'; their descriptions are
> >>similar to those for `std::map<>').
>
> > Yep. I'm not sure, if these members aren't an implementation
detail
> > only.
>
> Well, I have no idea how to use them in my `real' code ;o).
> But I guess that they must be `public' (ie. part of the interface)
so
> that expression templates can access them.
 
I've never checked, if private access works with static polymorphism
(under which compiler ;-) also, but I'll do that ASAP.
 
> Maybe you should mark
> them `For internal use only' in docs to prevent people like me
> to play with them ;o).
>
> > Thanks for your effort.
>
> Nothing at all. I hope that soon we'll have efficient and reliable
> vector/matrix library.
>
> fres
 
Regards
 
Joerg
 


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