.reference

git-svn-id: svn://ultimatepp.org/upp/trunk@10455 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2016-11-17 08:29:09 +00:00
parent 6b4db67068
commit ef168fa34d
2 changed files with 30 additions and 0 deletions

19
reference/Range/Range.cpp Normal file
View file

@ -0,0 +1,19 @@
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
Vector<int> v = { 1, 4, 7, 8, 12, 3, 6, 8, 9, 3, 6 };
// 0 1 2 3 4 5 6 7 8 9 10
DUMP(SubRange(v, 2, 7));
DUMP(ViewRange(v, Vector<int>{ 1, 4, 7 }));
DUMP(FilterRange(v, [](int c) { return c > 5; }));
DUMP(ConstRange(1, 5));
Sort(SubRange(v, 3, 4));
DUMP(v);
}

11
reference/Range/Range.upp Normal file
View file

@ -0,0 +1,11 @@
description "Demonstrates SubRange, ConstRange and ViewRange\377";
uses
Core;
file
Range.cpp;
mainconfig
"" = "";