mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-25 22:03:45 -06:00
.reference
git-svn-id: svn://ultimatepp.org/upp/trunk@7887 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
dc9ec7d974
commit
aeab9e4083
3 changed files with 47 additions and 0 deletions
32
reference/Tuple/Tuple.cpp
Normal file
32
reference/Tuple/Tuple.cpp
Normal 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));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue