[Assorted-commits] SF.net SVN: assorted:[903] sandbox/trunk/src/cc/cmpvec.cc
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-07-21 16:15:31
|
Revision: 903 http://assorted.svn.sourceforge.net/assorted/?rev=903&view=rev Author: yangzhang Date: 2008-07-21 16:15:40 +0000 (Mon, 21 Jul 2008) Log Message: ----------- added cmpvec Added Paths: ----------- sandbox/trunk/src/cc/cmpvec.cc Added: sandbox/trunk/src/cc/cmpvec.cc =================================================================== --- sandbox/trunk/src/cc/cmpvec.cc (rev 0) +++ sandbox/trunk/src/cc/cmpvec.cc 2008-07-21 16:15:40 UTC (rev 903) @@ -0,0 +1,25 @@ +// Vectors are comparable. I get: 0 1 0, as expected. +#include <vector> +#include <iostream> +using namespace std; +int main() { + { + vector<int> xs, ys; + xs.push_back(0); + ys.push_back(0); + cout << (xs < ys) << endl;; + } + { + vector<int> xs, ys; + xs.push_back(0); + ys.push_back(1); + cout << (xs < ys) << endl;; + } + { + vector<int> xs, ys; + xs.push_back(1); + ys.push_back(0); + cout << (xs < ys) << endl;; + } + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |