.reference

git-svn-id: svn://ultimatepp.org/upp/trunk@7887 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-11-13 11:06:16 +00:00
parent dc9ec7d974
commit aeab9e4083
3 changed files with 47 additions and 0 deletions

32
reference/Tuple/Tuple.cpp Normal file
View file

@ -0,0 +1,32 @@
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
Tuple2<int, String> x = Tuple(12, (const char *)"hello");
DUMP(x.a);
DUMP(x.b);
DUMP(x);
Tuple2<int, String> y = Tuple<int, String>(13, "hello");
DUMP(x == y);
y.a = 13;
DUMP(x == y);
int i; String s;
Tie(i, s) = x;
DUMP(i);
DUMP(s);
Index< Tuple2<int, String> > ndx;
ndx.Add(x);
ndx.Add(y);
DDUMP(ndx.Find(x));
DDUMP(ndx.Find(y));
}