Sets relations

Discussion in 'C++' started by Victor Nazarov, Jul 26, 2004.

  1. 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
    Victor Nazarov, Jul 26, 2004
    #1
    1. Advertising

  2. 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
    Thomas Matthews, Jul 26, 2004
    #2
    1. Advertising

  3. 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
    Victor Bazarov, Jul 26, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nicolas STAMPF
    Replies:
    0
    Views:
    393
    Nicolas STAMPF
    May 4, 2004
  2. Joe Van Meer

    data relations and datasets inquiry

    Joe Van Meer, May 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    426
    Joe Van Meer
    May 5, 2004
  3. Joe Van Meer

    data relations

    Joe Van Meer, May 5, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    381
    Joe Van Meer
    May 5, 2004
  4. =?Utf-8?B?UmF2aQ==?=

    Dropdownlist - relations - asp.net

    =?Utf-8?B?UmF2aQ==?=, May 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,063
    avnrao
    May 17, 2004
  5. Piotr Karwatka

    Data sets and relations between one table

    Piotr Karwatka, Dec 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    340
    Piotr Karwatka
    Dec 6, 2004
Loading...

Share This Page