Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 advcmp.h - Advanced Comparisons of lists and vectors
Index -> Programming, C++ -> C++ Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Fri Feb 13, 2004 10:21 pm   Post subject: advcmp.h - Advanced Comparisons of lists and vectors

The attached library works like so:

code:
#include <iostream>
#include <list>
#include <vector>
#include "advcmp.h"

int main()
{
    using namespace advcmp;
    using namespace std;

    list<int> l;
    l.push_back(1);
    l.push_back(1);
    l.push_back(1);

    vector<int> j;
    j.push_back(1);
    j.push_back(2);

    int a[] = { 0, 1, 2, 3, 4 };

    if (all<int>(l) != all<int>(j) && all<int>(l) == one<int>(5, a))
        cout << "hello" << endl;
    else
        cout << "world" << endl;
}


Oh yeah, and the astute will notice that it works with arrays too. Smile

Note: trying to get in and hack the file directly may result in brain damage. It is 1451 lines long.



advcmp.h
 Description:
C++ header file for doing advanced comparisons of lists, vectors, and arrays.

Download
 Filename:  advcmp.h
 Filesize:  34.6 KB
 Downloaded:  372 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, C++ -> C++ Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: