 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
MR Guest
|
Posted: Mon Dec 12, 2005 2:01 am Post subject: STLPort to DinkumSTL - Some functions missing... |
|
|
Currently porting some apps from BCB5 to BDS2006 (C++ Preview), I am
missing some functions like
binary_search()
lower_bound()
Is there something similar in DinkumSTL?
I implemented a quick (quick in implemetation, slow in usage)
workaround by sequentially running through the vector-elements, but
perhaps there is a much better solution, specialized for the different
kind of containers like lists (where the 'binary' search would not
work) or arrays (where it does), ...
Thanks,
Michael
|
|
| Back to top |
|
 |
Wayne A. King Guest
|
Posted: Mon Dec 12, 2005 2:47 am Post subject: Re: STLPort to DinkumSTL - Some functions missing... |
|
|
On Mon, 12 Dec 2005 03:01:37 +0100, MR <> wrote:
| Quote: | missing some functions like
binary_search()
lower_bound()
Is there something similar in DinkumSTL?
|
If you don't get an adequate answer here, I suggest you try the
Microsoft newsgroups on server msnews.microsoft.com
P.J. Plauger and other Dinkumware gurus regularly frequent the
STL group: microsoft.public.vc.stl
--
Wayne A. King
(waking (AT) idirect (DOT) com, [email]Wayne_A_King (AT) compuserve (DOT) com[/email])
|
|
| Back to top |
|
 |
Alan Bellingham Guest
|
Posted: Mon Dec 12, 2005 2:53 am Post subject: Re: STLPort to DinkumSTL - Some functions missing... |
|
|
MR <> wrote:
| Quote: | Currently porting some apps from BCB5 to BDS2006 (C++ Preview), I am
missing some functions like
binary_search()
lower_bound()
Is there something similar in DinkumSTL?
I implemented a quick (quick in implemetation, slow in usage)
workaround by sequentially running through the vector-elements, but
perhaps there is a much better solution, specialized for the different
kind of containers like lists (where the 'binary' search would not
work) or arrays (where it does), ...
|
Are you sure that you've #included <algorithm>, and that you are calling
std::binary_search?
(I can't see the Dinkumware STL missing that, or lower_bound.)
For a list, there is no good algorithm possible for binary_search.
Alan Bellingham
--
Team Thai Kingdom
<url:http://www.borland.com/newsgroups/> Borland newsgroup descriptions
<url:http://www.borland.com/newsgroups/netiquette.html> netiquette
|
|
| Back to top |
|
 |
MR Guest
|
Posted: Mon Dec 12, 2005 3:14 am Post subject: Re: STLPort to DinkumSTL - Some functions missing... |
|
|
Alan,
thanks a lot for the fast answer...
| Quote: | Are you sure that you've #included <algorithm>, and that you are calling
std::binary_search?
|
You are right. I didn't (and I hadn't at BCB5).
Doing it I can now use both functions directly.
Thanks again,
Michael
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|