Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: expressing a certain algebraic statement in C++ STL

Reply
Thread Tools

Re: expressing a certain algebraic statement in C++ STL

 
 
Michel Rosien
Guest
Posts: n/a
 
      04-22-2004
> > Hello mates
> >
> > How do you express the test "Does the value x belong in the set S ?"
> > using the STL containers and algorithms ?

>
> Assuming you're talking about std::set, the test is
>
> S.find(x) != S.end();
>



To only determine whether a certain value is in a std::set I always use:

S.count(x) > 0

--Michel



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is x.f() <==>MyClass.f(x) a kind of algebraic structure? steve Python 3 10-23-2006 12:03 PM
Algebraic Parser DennisNedry C++ 6 02-02-2005 07:21 PM
[OWL] expressing relationships Rob Heersma XML 0 06-15-2004 12:01 PM
Re: expressing a certain algebraic statement in C++ STL Mike Wahler C++ 1 04-01-2004 02:40 PM
Expressing time. Sean Python 1 07-14-2003 03:57 PM



Advertisments