ultimatepp/tutorial/Ntl15/Ntl15.cpp
cxl 0fb7545c3a .tutorial: C++11 fixes
git-svn-id: svn://ultimatepp.org/upp/trunk@7176 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2014-04-05 16:45:54 +00:00

36 lines
581 B
C++

#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
Tuple3<int, String, String> x = MakeTuple<int, String, String>(12, "hello", "world");
DUMP(x.a);
DUMP(x.b);
DUMP(x.c);
DUMP(x);
DUMP(GetHashValue(x));
Tuple3<int, String, String> y = x;
DUMP(x != y);
DUMP(x.Compare(y));
y.b = "a";
DUMP(SgnCompare(x, y));
DUMP(x < y);
static Tuple2<int, const char *> map[] = {
{ 1, "one" },
{ 2, "one" },
{ 3, "one" },
};
Tuple2<int, const char *> *f = FindTuple(map, __countof(map), 2);
if(f)
DUMP(f->b);
}