Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Sets relations

Reply
Thread Tools

Sets relations

 
 
Victor Nazarov
Guest
Posts: n/a
 
      07-26-2004
Sorry for a dumb question, but it's hard to find an answer.
How can I check in C++ if one set supersedes another? operator < ?
Actually I want to check if two sets are not equal and none of them
supersedes the other.

--
vir
 
Reply With Quote
 
 
 
 
Thomas Matthews
Guest
Posts: n/a
 
      07-26-2004
Victor Nazarov wrote:

> Sorry for a dumb question, but it's hard to find an answer.
> How can I check in C++ if one set supersedes another? operator < ?
> Actually I want to check if two sets are not equal and none of them
> supersedes the other.
>
> --
> vir


I would think that you would need to do a "for each" on
the set using a "supercedes" function. So how are you
defining "supercede"?


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      07-26-2004
Thomas Matthews wrote:
> Victor Nazarov wrote:
>
>> Sorry for a dumb question, but it's hard to find an answer.
>> How can I check in C++ if one set supersedes another? operator < ?
>> Actually I want to check if two sets are not equal and none of them
>> supersedes the other.
>>
>> --
>> vir

>
>
> I would think that you would need to do a "for each" on
> the set using a "supercedes" function. So how are you
> defining "supercede"?


I believe the OP by "supercede" means the one is a superset of
the other. The only verification I can think of is that the
one includes the other. IOW

std::set<sometype> A, B;
... // fill A and B

if (std::includes(B.begin(), B.end(), A.begin(), A.end()))
std::cout << "B is a superset of A";

Victor
 
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
Data sets and relations between one table Piotr Karwatka ASP .Net 1 12-06-2004 04:04 PM
Dropdownlist - relations - asp.net =?Utf-8?B?UmF2aQ==?= ASP .Net 1 05-17-2004 07:13 AM
data relations Joe Van Meer ASP .Net 4 05-05-2004 06:57 PM
data relations and datasets inquiry Joe Van Meer ASP .Net 0 05-05-2004 01:30 PM
Can't decide between Relations::Family and Class::DBI Nicolas STAMPF Perl 0 05-04-2004 12:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57