BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

STLPort to DinkumSTL - Some functions missing...

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
MR
Guest





PostPosted: Mon Dec 12, 2005 2:01 am    Post subject: STLPort to DinkumSTL - Some functions missing... Reply with 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), ...

Thanks,

Michael




Back to top
Wayne A. King
Guest





PostPosted: Mon Dec 12, 2005 2:47 am    Post subject: Re: STLPort to DinkumSTL - Some functions missing... Reply with quote



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





PostPosted: Mon Dec 12, 2005 2:53 am    Post subject: Re: STLPort to DinkumSTL - Some functions missing... Reply with quote



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





PostPosted: Mon Dec 12, 2005 3:14 am    Post subject: Re: STLPort to DinkumSTL - Some functions missing... Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.