mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.docs
git-svn-id: svn://ultimatepp.org/upp/trunk@8607 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9b88fe7133
commit
f37792b6e3
7 changed files with 1175 additions and 7267 deletions
|
|
@ -1,15 +1,127 @@
|
|||
TITLE("Overview of U++ containers - NTL")
|
||||
COMPRESSED
|
||||
120,156,173,88,13,111,219,70,18,253,43,11,56,119,72,28,89,230,242,155,82,81,52,113,26,92,128,54,1,154,244,128,131,161,84,20,181,178,246,76,145,42,151,180,163,59,92,127,251,189,153,93,82,148,221,184,61,224,26,212,150,41,238,124,188,121,243,102,200,107,95,60,123,230,77,188,51,239,15,254,155,189,81,155,188,43,219,197,117,233,167,233,92,39,94,56,207,101,50,255,144,205,127,251,237,183,105,150,249,115,50,37,97,74,122,97,32,125,41,67,207,11,253,68,70,153,151,69,169,76,189,32,9,253,40,241,162,217,62,111,242,221,226,58,79,131,249,249,79,49,78,249,147,232,44,144,129,244,100,236,135,184,203,11,60,63,148,126,36,211,52,148,73,148,6,89,28,207,138,124,223,234,186,90,92,175,232,28,57,11,112,204,75,210,56,148,56,20,70,126,144,68,33,14,135,161,148,248,44,163,36,78,146,89,171,219,82,225,144,140,147,121,30,250,243,43,58,25,78,226,51,132,231,39,56,26,250,97,28,6,169,31,200,212,247,227,44,8,179,16,113,75,127,166,91,133,
|
||||
40,87,56,67,231,232,88,4,135,97,20,202,0,128,132,73,20,224,182,4,191,67,47,147,62,188,166,94,20,193,161,250,210,163,68,0,209,185,24,238,252,36,162,187,211,48,149,65,146,250,161,31,251,8,192,75,144,37,121,143,102,107,101,10,156,11,124,57,111,17,210,252,234,187,104,46,113,56,153,36,103,190,151,121,126,156,100,112,136,96,145,112,144,101,50,72,225,48,148,145,39,131,89,81,175,41,73,63,242,2,246,152,162,14,49,44,51,38,81,44,17,176,31,164,112,153,200,32,192,207,40,76,147,153,81,84,137,182,110,22,215,231,223,61,247,166,222,212,143,162,23,116,60,195,241,52,8,131,32,140,179,80,122,1,220,192,70,72,120,197,30,106,41,35,63,157,173,114,3,159,109,72,200,50,170,146,136,4,224,131,52,10,224,58,198,15,20,21,9,6,192,198,207,194,52,8,82,111,86,148,185,49,35,128,206,41,73,41,39,82,158,37,132,107,20,248,97,70,224,4,62,0,246,227,40,147,64,56,138,67,207,159,53,234,215,78,55,106,167,42,64,172,193,141,121,95,
|
||||
30,199,67,4,99,121,232,79,164,15,38,70,113,236,17,94,17,216,224,7,17,0,247,100,26,34,34,252,67,137,91,71,197,213,49,135,96,34,131,179,204,15,3,68,146,133,33,16,128,1,153,73,41,189,20,255,144,25,112,97,110,72,132,192,73,88,247,246,120,56,145,225,89,2,14,163,82,89,72,238,179,128,240,243,1,191,31,123,17,234,224,219,227,62,161,238,63,3,238,210,79,233,127,70,94,70,19,137,102,64,136,50,138,144,119,0,168,253,20,185,71,192,62,96,126,203,36,157,189,87,247,230,77,222,42,71,152,243,171,103,150,105,50,158,200,248,204,163,243,81,154,161,128,50,36,252,130,48,204,252,44,8,34,63,139,130,216,3,142,198,246,50,29,166,126,226,94,28,140,36,19,153,160,179,144,107,20,33,123,62,134,204,19,73,161,248,105,22,19,10,206,200,242,162,212,21,197,1,102,204,45,25,206,175,94,74,153,144,161,20,13,147,166,177,23,100,0,3,24,120,17,152,14,53,72,81,104,212,217,71,27,144,28,20,183,249,141,90,94,184,86,253,247,47,255,249,
|
||||
203,247,239,47,126,254,40,174,141,63,23,31,238,84,115,167,213,189,168,55,226,231,229,203,229,75,81,212,85,155,195,105,99,196,242,66,188,255,244,195,95,23,215,38,154,211,39,161,141,200,69,169,87,77,222,28,232,196,112,175,200,171,181,200,203,155,186,209,237,118,39,80,128,125,9,0,205,84,188,107,233,20,218,79,223,84,106,45,218,90,152,186,188,83,248,185,83,98,223,212,171,82,237,140,184,199,5,165,132,174,68,209,53,13,8,40,174,56,24,211,194,112,222,172,7,167,31,63,253,48,165,128,130,185,248,9,95,213,59,145,23,133,50,198,5,249,125,94,108,133,209,213,77,169,56,224,99,128,125,72,162,221,230,173,40,242,10,182,235,70,137,29,253,192,181,74,212,149,18,170,100,250,139,109,110,68,51,182,63,21,159,182,250,193,53,134,195,136,77,110,90,250,237,46,118,228,94,128,131,220,252,6,137,138,77,221,184,11,244,149,243,97,196,161,238,56,144,206,80,230,107,141,227,112,208,110,41,90,10,232,104,131,208,5,68,141,42,234,29,206,2,70,10,38,223,3,
|
||||
63,36,60,0,114,236,223,30,143,87,176,178,219,215,13,96,108,197,70,229,109,135,108,81,56,194,38,111,200,226,241,8,135,201,160,172,135,24,167,226,231,170,212,183,138,112,159,136,251,173,6,188,132,141,131,248,250,18,8,239,15,203,11,224,108,218,166,43,90,141,122,46,56,94,124,7,41,66,213,115,190,52,242,196,142,238,183,53,12,184,178,78,56,160,93,126,75,8,140,67,170,43,177,7,28,167,60,83,119,202,94,222,169,118,91,175,5,164,82,247,5,186,207,15,54,185,178,172,239,13,5,177,134,177,162,93,112,102,4,63,178,167,208,170,195,66,180,135,61,163,113,204,150,142,2,212,59,13,194,138,246,190,22,136,148,221,181,219,6,252,220,148,249,29,213,131,18,80,68,53,114,93,136,87,111,62,137,91,84,240,180,37,26,5,190,105,80,29,156,127,132,243,224,210,213,238,173,181,236,202,118,125,126,41,254,142,168,49,60,156,207,19,211,3,72,134,83,48,228,97,165,232,212,231,245,126,191,156,45,47,151,151,31,235,174,41,212,155,186,88,94,94,13,231,150,151,
|
||||
63,214,119,138,10,242,25,196,183,159,108,181,182,57,2,85,154,201,247,103,236,236,117,113,187,252,229,51,26,91,237,153,3,98,160,0,77,188,63,125,94,44,200,123,189,183,76,159,252,79,190,233,247,137,91,49,182,69,165,91,219,181,106,124,211,84,28,77,17,168,220,73,14,99,6,225,190,134,220,92,159,15,248,107,42,190,210,141,251,89,229,59,101,208,10,128,138,174,8,245,165,80,188,58,49,177,206,197,187,106,173,190,44,92,171,80,147,150,16,128,83,63,142,170,131,83,195,134,86,10,50,210,116,85,171,33,140,197,22,163,179,64,255,107,211,234,194,178,196,241,226,85,211,228,135,175,208,130,108,209,61,85,189,0,199,197,130,228,2,145,125,149,125,19,177,234,88,159,75,82,46,181,217,232,66,227,250,84,252,99,44,77,45,171,54,171,165,109,189,186,60,64,54,247,72,209,242,15,9,185,78,122,32,31,98,93,131,157,85,221,218,131,140,175,229,42,42,163,105,30,64,139,41,249,125,173,161,11,48,160,43,146,252,86,231,4,233,132,196,115,172,146,156,123,159,58,
|
||||
12,21,141,34,73,71,131,119,141,161,86,91,231,109,46,108,169,161,116,8,236,21,156,19,167,71,218,55,174,184,54,118,30,52,106,163,48,118,10,219,75,67,248,36,145,21,66,199,141,213,93,94,106,152,87,235,63,100,16,88,224,138,52,112,135,88,211,183,250,232,52,77,25,133,184,42,1,235,157,114,237,127,73,2,53,18,177,81,129,45,120,128,98,253,232,236,132,188,57,93,102,190,147,228,51,153,108,71,0,207,126,26,179,93,152,88,29,108,29,72,22,205,94,21,26,245,23,88,156,62,183,53,122,203,246,224,21,10,186,188,52,77,209,247,221,242,153,170,150,23,157,249,44,90,76,67,3,220,48,186,119,84,179,194,44,250,28,95,179,46,158,78,203,99,26,142,205,220,5,143,116,211,244,105,231,235,53,2,187,4,111,161,199,227,185,233,56,163,236,65,250,104,64,112,170,30,65,144,131,154,173,254,23,210,59,65,1,84,224,62,51,234,196,21,10,108,53,124,213,233,146,252,137,85,89,23,183,182,77,222,211,208,27,181,61,223,206,254,240,23,21,192,94,165,91,17,
|
||||
243,233,140,152,142,53,196,177,195,37,102,39,82,15,11,74,218,65,51,154,242,64,222,175,196,29,159,57,29,75,35,83,60,90,207,79,85,192,65,38,6,168,232,38,116,146,106,90,55,241,198,216,97,244,161,223,140,102,209,122,206,66,6,157,216,151,234,139,110,15,132,6,160,195,55,85,183,91,169,147,56,120,100,172,95,12,53,214,54,17,152,201,203,255,95,117,219,250,114,211,128,53,43,52,46,200,126,163,171,170,79,201,85,124,92,237,161,198,199,178,219,106,91,166,223,43,212,197,116,216,164,214,92,166,183,239,222,126,56,246,131,69,246,181,126,128,237,107,237,208,229,114,99,9,232,81,134,239,213,87,146,238,65,97,249,239,27,217,182,1,18,62,76,172,74,60,94,18,134,101,227,180,87,134,20,89,157,78,32,251,90,31,252,9,84,196,243,93,135,169,196,11,221,234,201,14,125,97,7,28,173,196,93,165,97,184,23,208,25,141,3,23,15,47,190,208,160,70,43,72,16,197,48,208,234,200,26,107,104,80,23,214,170,169,248,91,110,182,188,38,27,43,102,84,27,70,
|
||||
104,172,85,22,74,120,216,67,202,201,20,128,130,159,190,83,151,23,163,86,37,82,99,221,172,11,109,119,174,7,53,118,83,121,220,60,124,9,235,199,227,26,107,235,216,13,221,115,62,97,44,31,249,171,99,215,145,122,32,154,150,250,5,154,73,135,1,37,22,8,22,146,39,17,102,97,57,244,245,71,146,249,122,121,81,87,229,161,191,181,223,60,121,203,57,166,67,122,193,72,13,166,104,157,0,21,118,10,106,60,76,75,211,237,247,176,53,234,42,177,224,140,145,12,233,62,89,165,32,23,150,251,148,35,120,115,188,101,180,49,81,36,55,170,237,111,165,111,199,162,128,207,199,99,176,65,66,116,58,127,78,51,152,138,143,164,158,52,121,27,226,21,172,47,184,32,116,158,10,180,56,150,167,223,123,94,97,137,154,144,224,238,106,195,107,194,166,171,92,15,146,102,161,49,236,163,229,211,144,147,79,86,110,242,201,229,124,130,25,139,201,224,108,4,62,85,220,96,55,83,107,219,102,188,94,13,143,150,252,242,133,205,244,38,236,26,56,48,216,56,2,29,251,159,186,163,
|
||||
238,120,67,197,50,211,170,97,69,124,42,52,14,3,35,3,68,71,235,144,88,50,35,198,142,157,86,108,232,201,254,24,254,208,134,182,223,104,176,245,227,202,233,215,143,249,254,119,196,107,135,171,236,244,159,29,32,49,154,166,5,15,13,215,239,204,2,219,80,20,237,147,101,56,46,147,253,222,210,110,59,67,12,227,97,197,24,146,95,114,234,222,27,144,22,136,141,30,150,123,94,13,199,90,115,139,78,66,61,108,4,218,244,162,68,91,18,14,177,31,139,147,141,236,81,72,78,73,153,28,131,93,221,47,88,180,242,241,52,179,209,216,149,190,215,100,54,197,237,78,132,66,32,230,232,115,120,25,96,31,238,167,194,33,139,108,10,140,89,138,156,144,157,184,99,128,36,47,241,0,107,250,53,26,41,13,52,152,216,81,96,187,156,63,30,87,216,225,73,147,245,131,4,194,173,227,46,138,231,20,17,251,216,81,253,86,106,120,248,123,49,218,45,80,250,197,100,96,26,253,213,83,239,163,186,113,223,115,144,35,169,164,240,121,179,98,149,63,9,86,245,237,49,226,223,131,
|
||||
109,153,140,49,151,72,73,108,190,67,47,209,30,50,106,40,114,62,117,58,208,107,215,200,112,63,2,246,121,211,246,113,89,64,239,114,93,82,166,61,193,63,84,106,120,152,162,63,22,246,165,214,136,158,253,251,161,109,93,174,121,2,194,118,53,122,57,100,134,173,211,118,19,73,15,227,141,16,236,167,147,214,212,45,45,35,102,36,89,168,145,123,205,83,148,181,81,182,33,30,188,231,202,187,182,94,254,178,111,27,126,66,99,116,129,20,134,133,11,1,80,13,139,136,123,161,51,177,131,253,241,86,62,25,202,205,50,131,199,85,241,252,64,141,71,195,130,94,225,228,213,194,62,185,88,34,124,67,184,124,243,233,91,241,237,11,251,68,77,177,26,139,62,141,127,0,54,122,169,68,57,58,179,29,186,150,94,38,226,177,82,21,185,123,118,164,187,91,43,247,244,176,182,182,81,142,17,31,191,243,202,237,163,32,166,26,85,201,155,11,251,11,12,168,14,238,202,53,255,241,245,186,89,113,169,92,229,220,19,81,191,141,60,120,251,51,122,150,59,174,98,239,12,37,239,94,
|
||||
46,161,56,107,232,114,179,195,61,92,245,246,119,31,117,25,168,43,206,240,244,176,123,68,229,69,205,221,106,23,52,55,188,31,164,249,186,219,160,118,199,76,237,223,46,89,39,188,95,19,214,126,150,220,52,245,61,245,7,18,218,211,35,128,91,101,6,47,98,241,95,234,220,243,194,
|
||||
|
||||
topic "Overview of U++ containers - NTL";
|
||||
[2 $$0,0#00000000000000000000000000000000:Default]
|
||||
[l288;i704;a17;O9;~~~.992;2 $$1,0#10431211400427159095818037425705:param]
|
||||
[a83;*R6 $$2,5#31310162474203024125188417583966:caption]
|
||||
[b83;*2 $$3,5#07864147445237544204411237157677:title]
|
||||
[b167;a42;C2 $$4,6#40027414424643823182269349404212:item]
|
||||
[b42;a42;2 $$5,5#45413000475342174754091244180557:text]
|
||||
[l288;a17;2 $$6,6#27521748481378242620020725143825:desc]
|
||||
[l321;t246;C@5;1 $$7,7#20902679421464641399138805415013:code]
|
||||
[b2503;2 $$8,0#65142375456100023862071332075487:separator]
|
||||
[*@(0.0.255)2 $$9,0#83433469410354161042741608181528:base]
|
||||
[t4167;C2 $$10,0#37138531426314131251341829483380:class]
|
||||
[l288;a17;*1 $$11,11#70004532496200323422659154056402:requirement]
|
||||
[i417;b42;a42;O9;~~~.416;2 $$12,12#10566046415157235020018451313112:tparam]
|
||||
[b167;C2 $$13,13#92430459443460461911108080531343:item1]
|
||||
[i288;a42;O9;C2 $$14,14#77422149456609303542238260500223:item2]
|
||||
[*@2$(0.128.128)2 $$15,15#34511555403152284025741354420178:NewsDate]
|
||||
[l321;*C$7;2 $$16,16#03451589433145915344929335295360:result]
|
||||
[l321;b83;a83;*C$7;2 $$17,17#07531550463529505371228428965313:result`-line]
|
||||
[l160;t4167;*C+117 $$18,5#88603949442205825958800053222425:package`-title]
|
||||
[{_}%EN-US
|
||||
[s2; Overview of U`+`+ containers `- NTL&]
|
||||
[s5; NTL is a library of container and algorithm templates. It is
|
||||
designed to solve some problems we see in current C`+`+ standard
|
||||
library STL.&]
|
||||
[s3; Random access&]
|
||||
[s5; Each single NTL container template that can store more than
|
||||
one element has random access. This random access is as fast
|
||||
as access using iterators so for iterating elements you can use
|
||||
indices rather than iterators and we recommend this approach.&]
|
||||
[s3; Requirements&]
|
||||
[s5; An important feature of NTL are requirements for stored elements.
|
||||
Unlike STL, which has single [/ copy`-constructible] and [/ assignable]
|
||||
requirement for whole library, NTL makes requirements on per
|
||||
container and even per method basis. This way NTL allows [/ direct]
|
||||
storing of [/ any] type of elements. NTL provides two or even three
|
||||
flavors for each basic ADT kind of container relative to requirements
|
||||
for elements.&]
|
||||
[s3; Flavors&]
|
||||
[s5; [*/ Vector] flavor of containers requires types to be [*/^dpp`:`/`/SourceDoc`/Containers`/Moveable^ m
|
||||
oveable] and have either [*/^dpp`:`/`/SourceDoc`/Containers`/pick`_^ deep
|
||||
copy constructor][^dpp`:`/`/SourceDoc`/Containers`/pick`_^ ]and
|
||||
operator, [*/^dpp`:`/`/SourceDoc`/Containers`/pick`_^ pick constructor]
|
||||
and operator or default constructor. Containers of this flavor
|
||||
have word [* Vector] in their their names, with the exception of
|
||||
[* Index] which is also of this flavor. This flavor has the best
|
||||
runtime characteristics.&]
|
||||
[s5; [*/ Array] flavor of containers has [*/ no][/ ]common requirements
|
||||
for elements, but is less efficient. You can use it to store
|
||||
even polymorphic types. Type of stored elements does not even
|
||||
have to be defined at the point of instantiation, so you can
|
||||
use Array flavor to create recursive data structures. Another
|
||||
feature of this flavor is that references to elements are never
|
||||
invalidated. Containers of this flavor have [* Array] in their
|
||||
name.&]
|
||||
[s3; Containers as return values&]
|
||||
[s5; NTL allows containers to be used as return values, in single
|
||||
constant time operation. It is allowed by defining specific [*/^topic`:`/`/Core`/src`/pick`_`$en`-us^ t
|
||||
ransfer semantics][/ .]&]
|
||||
[s3; Basic random access containers&]
|
||||
[s5; This kind of containers allows adding/removing elements at the
|
||||
end of the sequence in amortized constant time. As these containers
|
||||
are basic building blocks for NTL, their names are the same as
|
||||
names for all three flavors. [* Vector] flavor allows direct access
|
||||
to underlying C vector of elements. [* Vector] and [* Array] flavors
|
||||
allow removing and inserting of elements at any position (with
|
||||
complexity based on number of elements moved).&]
|
||||
[s3; Bidirectional containers&]
|
||||
[s5; This kind of containers allows adding/removing elements to/from
|
||||
both beginning and end of sequence in constant amortized time.
|
||||
It is well suited for FIFO operations. [* BiVector] and [* BiArray]
|
||||
are two flavors of bidirectional containers.&]
|
||||
[s3; Index&]
|
||||
[s5; Basically, this kind of container provides random access sequence
|
||||
that allows adding elements at the end of sequence in constant
|
||||
amortized time (much like basic random access containers) with
|
||||
one unique feature: it allows fast retrieval of position of element
|
||||
with specific value. Hashing is used for this operation. Indexes
|
||||
represent ideal building`-blocks for any associative operations.
|
||||
[* Index] and [* ArrayIndex ]are two flavors of indexes.&]
|
||||
[s5; As both index flavors are built on top of according basic random
|
||||
access containers, they provide read`-only access or even pick
|
||||
operations to this container. That means you can supply elements
|
||||
to [* Index] by picking [* Vector ]in [* Index] constructor or get
|
||||
[* Vector] of elements of [* Index] in low constant time pick operation.
|
||||
Same is true for [* Array] and [* ArrayIndex.]&]
|
||||
[s5; Also, as most of functionality added to basic random access
|
||||
containers is same for both [* Index] and [* ArrayIndex], most of
|
||||
operations are shared in common template class [* AIndex], which
|
||||
represents index container without concrete flavor. [* Index] and
|
||||
[* ArrayIndex] are derived from this [* AIndex], adding few operations
|
||||
specific for their flavors.&]
|
||||
[s3; Maps&]
|
||||
[s5; Basically, maps are just simple compositions of Index and basic
|
||||
random access container to store values, thus getting classical
|
||||
map design. In find operation, position of key in Index is retrieved
|
||||
and value from basic access container at the same position is
|
||||
returned. This design also allows accessing both keys and values
|
||||
using indices. &]
|
||||
[s5; In case of maps, keys are always stored in [* Index], that means
|
||||
that flavor is relative only to type of values (and keys must
|
||||
be moveable). [* VectorMap], [* ArrayMap] and [* SegtorMap] are flavors
|
||||
of maps. As with [* Index], the common operations of this flavor
|
||||
are implemented in template base class [* AMap]. Also, picking
|
||||
operations for any part of maps are available.&]
|
||||
[s3; InVector, Sorted maps&]
|
||||
[s5; NTL provides random access containers with fast insertion at
|
||||
arbitrary position, which scale well to milions of items. These
|
||||
containers then provide basis for `'sorted maps`' that are using
|
||||
binary search. Sorted maps are useful when range`-search is required.&]
|
||||
[s3; One&]
|
||||
[s5; [* One] is a container that can hold one or none elements of the
|
||||
specified type or a type derived from it. Its functionally rather
|
||||
close to standard library auto`_ptr but with improvements in
|
||||
direction of NTL, like transfer semantics, moveable concept (yes,
|
||||
you [/ can] have Vector< One<T> >) and others. Also it is important
|
||||
from conceptual view, because it is it is treated like a container
|
||||
rather than a pointer.&]
|
||||
[s3; Any&]
|
||||
[s5; Any is a container that can store none or single element of
|
||||
[/ any] type. Container provides Is<T> method to determine the
|
||||
type of stored element and Create<T> method to create the element
|
||||
in container.&]
|
||||
[s3; Buffer&]
|
||||
[s5; Buffer is a simple random access container without growing properties.&]
|
||||
[s0; &]
|
||||
[s0; ]]
|
||||
|
|
@ -58,9 +58,9 @@ ndex], is introduced, as an ideal building block for all kinds
|
|||
of associative operations.&]
|
||||
[s5; [* InVector, Sorted maps]&]
|
||||
[s5; NTL provides random access containers with fast insertion at
|
||||
arbitrary position, which scale well to milions of items. This
|
||||
is then based to create `'sorted maps`' that are using binary
|
||||
search.&]
|
||||
arbitrary position, which scale well to milions of items. These
|
||||
containers then provide basis for `'sorted maps`' that are using
|
||||
binary search.&]
|
||||
[s3; Algorithm requirements&]
|
||||
[s5; Requirements of STL algorithms are very loosely defined. NTL
|
||||
tries to provide more specific requirements and also minimal
|
||||
|
|
|
|||
|
|
@ -685,11 +685,75 @@ POD arrays to be intialized with classic C style:&]
|
|||
[s7; -|-|`{ 3, `"one`" `},&]
|
||||
[s7; -|`};&]
|
||||
[s7; -|&]
|
||||
[s5; &]
|
||||
[s5; Simple FindTuple template function is provided to search for
|
||||
tuple based on the first value:&]
|
||||
[s7; &]
|
||||
[s7; -|Tuple2<int, const char `*> `*f `= FindTuple(map, `_`_countof(map),
|
||||
2);&]
|
||||
[s7; -|if(f)&]
|
||||
[s7; -|-|DUMP(f`->b);&]
|
||||
[s3; 15. Sorting&]
|
||||
[s5; IndexSort is sort variant that is able to sort two random access
|
||||
container (like Vector or Array) of the same size, based on values
|
||||
in on of containers:&]
|
||||
[s7; -|Vector<int> a;&]
|
||||
[s7; -|Vector<String> b;-|&]
|
||||
[s7; -|&]
|
||||
[s7; -|a << 5 << 10 << 2 << 9 << 7 << 3;&]
|
||||
[s7; -|b << `"five`" << `"ten`" << `"two`" << `"nine`" << `"seven`"
|
||||
<< `"three`";&]
|
||||
[s7; -|&]
|
||||
[s7; -|[* IndexSort](a, b);&]
|
||||
[s7; &]
|
||||
[s16; a `= `[2, 3, 5, 7, 9, 10`]&]
|
||||
[s16; b `= `[two, three, five, seven, nine, ten`]&]
|
||||
[s7; &]
|
||||
[s7; -|[* IndexSort](b, a);&]
|
||||
[s7; &]
|
||||
[s16; a `= `[5, 9, 7, 10, 3, 2`]&]
|
||||
[s16; b `= `[five, nine, seven, ten, three, two`]&]
|
||||
[s5; Order of sorted items is defined by sorting predicate. By default,
|
||||
operator< comparing items of container is used (this predicate
|
||||
can be provided by StdLess template), but it is possible to specify
|
||||
different sorting order, e.g. by using predefined StdGreater
|
||||
predicate:&]
|
||||
[s7; -|Sort(a, [* StdGreater]<int>());&]
|
||||
[s7; &]
|
||||
[s16; a `= `[10, 9, 7, 5, 3, 2`]&]
|
||||
[s5; Sometimes, instead of sorting items in the container, it is
|
||||
useful to know the order of items as sorted, using GetSortOrder:&]
|
||||
[s7; -|Vector<int> o `= [* GetSortOrder](a);&]
|
||||
[s7; &]
|
||||
[s16; o `= `[5, 4, 3, 2, 1, 0`]&]
|
||||
[s5; FieldRelation predefined predicate can be used to sort container
|
||||
of structures by specific field:&]
|
||||
[s7; -|Vector<Point> p;&]
|
||||
[s7; -|p << Point(5, 10) << Point(7, 2) << Point(4, 8) << Point(1,
|
||||
0);&]
|
||||
[s7; -|&]
|
||||
[s7; -|Sort(p, [* FieldRelation](`&Point`::x, StdLess<int>()));&]
|
||||
[s7; &]
|
||||
[s16; p `= `[`[1, 0`], `[4, 8`], `[5, 10`], `[7, 2`]`]&]
|
||||
[s5; MethodRelation is good for sorting of structures based on constant
|
||||
method of structure:-|&]
|
||||
[s7; struct Foo `{&]
|
||||
[s7; -|String a;&]
|
||||
[s7; -|&]
|
||||
[s7; -|int [* Get]() const `{ return atoi(a); `}&]
|
||||
[s7; -|....&]
|
||||
[s7; `};&]
|
||||
[s7; ....&]
|
||||
[s7; -|Array<Foo> f;&]
|
||||
[s7; -|f << `"12`" << `"1`" << `"10`" << `"7`" << `"5`";&]
|
||||
[s7; -|&]
|
||||
[s7; -|Sort(f, [* MethodRelation](`&Foo`::[* Get], StdLess<int>()));&]
|
||||
[s7; &]
|
||||
[s16; f `= `[1, 5, 7, 10, 12`]&]
|
||||
[s5; Normal Sort is not stable `- equal items can appear in sorted
|
||||
sequence in random order. If maintaining original order of equal
|
||||
items is important, use StableSort variant (with slight performance
|
||||
penalty):&]
|
||||
[s7; -|Vector<Point> t;&]
|
||||
[s7; -|t << Point(10, 10) << Point(7, 1) << Point(7, 2) << Point(7,
|
||||
3) << Point(1, 0);&]
|
||||
[s7; -|[* StableSort](t, FieldRelation(`&Point`::x, StdLess<int>()));&]
|
||||
[s7; &]
|
||||
[s16; t `= `[`[1, 0`], `[7, 1`], `[7, 2`], `[7, 3`], `[10, 10`]`]&]
|
||||
[s7; ]]
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,7 @@
|
|||
topic "Rectangular blocks are activated by pressing ALT key.";
|
||||
[ $$0,0#00000000000000000000000000000000:Default]
|
||||
[{_}%EN-US
|
||||
[s0;=i150;O2; Use Ctrl`+Tab to cycle throught files. This is perhaps
|
||||
[s0;i160;O2; Use Ctrl`+Tab to cycle throught files. This is perhaps
|
||||
the most used key in theide!&]
|
||||
[s0;i150;O2; Use Alt`+Left to `"return`" to important places (e.g.
|
||||
where you have written something). Use Alt`+Right to cycle this
|
||||
|
|
@ -15,18 +15,4 @@ is on clipboard, all text is copied.&]
|
|||
[s0;i150;O2; Dragging file onto TheIDE opens it (as `"temp`" file).&]
|
||||
[s0;i150;O2; Use Ctrl`+/ to hide project overview `- useful e.g.
|
||||
when editing wide layouts.&]
|
||||
[s0;i150;O2; Use Ctrl`+`-, Ctrl`+`| to split editor vertically/horizontally.&]
|
||||
[s0;i150;O2; In navigator search field you can write&]
|
||||
[s0;l160;i150;O1; write line number to reach the line&]
|
||||
[s0;l160;i150;O1; `'.`' lists everything&]
|
||||
[s0;l160;i150;O1; `'CAT`' lists all elements where class name or
|
||||
member name contains `'CAT`' (case ignored)&]
|
||||
[s0;l160;i150;O1; `'STRING.CAT`' lists all elements where class name
|
||||
contains `'STRING`' and member name contains `'CAT`' (case ignored)&]
|
||||
[s0;l160;i150;O1; `'.STRING.CAT`' lists all elements where class
|
||||
name [/ is equal] `'STRING`' and member name contains `'CAT`' (case
|
||||
ignored)&]
|
||||
[s0;l160;i150;O1; `'.STRING.`' lists all members of STRING class
|
||||
(case ignored, so it is String too)&]
|
||||
[s0;l160;i150;O1; `'STRING.`' lists all classes that contain STRING
|
||||
(case ignored)]]
|
||||
[s0;i150;O2; Use Ctrl`+`-, Ctrl`+`| to split editor vertically/horizontally.]]
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
TITLE("Rectangular blocks are activated by pressing ALT key.")
|
||||
COMPRESSED
|
||||
120,156,181,84,93,111,211,64,16,252,43,75,41,52,81,83,55,69,130,7,34,30,170,182,66,145,42,144,218,20,9,69,17,190,156,55,246,209,243,157,185,91,39,152,143,255,206,174,221,208,38,148,47,33,162,60,228,178,222,153,217,217,57,79,97,119,119,56,24,62,28,254,230,243,252,20,23,170,182,52,155,126,126,247,245,209,217,171,131,171,75,152,198,225,232,133,57,122,58,28,189,126,50,130,171,136,112,66,193,166,251,19,53,7,242,160,27,109,17,168,8,190,206,11,130,133,177,24,19,152,20,38,2,127,43,12,133,170,34,215,17,74,31,9,234,136,25,92,99,3,198,201,159,38,195,7,143,103,66,177,193,112,108,41,221,63,199,5,9,67,186,19,144,234,224,210,29,57,153,178,242,129,148,35,168,172,210,24,161,135,73,158,192,170,192,128,208,248,26,10,181,68,88,5,67,132,14,162,47,145,10,227,242,126,114,11,124,97,68,233,29,237,34,180,3,91,248,176,82,33,75,182,52,157,69,221,138,214,214,71,161,84,46,131,128,190,66,23,251,237,108,115,79,228,75,168,
|
||||
148,67,232,173,12,21,160,125,89,25,171,200,120,199,143,70,54,53,2,146,78,146,164,191,5,126,129,154,231,201,107,171,2,204,173,215,215,17,20,207,162,52,153,165,34,182,107,222,64,197,16,145,199,128,227,243,137,40,217,22,248,150,7,215,202,49,107,213,116,59,128,94,183,166,19,113,58,54,145,176,108,11,80,42,167,114,12,131,155,53,190,145,250,164,192,241,233,89,159,127,178,43,132,31,9,50,19,88,150,109,18,24,47,120,115,65,108,98,124,209,192,24,45,16,187,198,179,105,107,170,185,103,207,6,160,172,237,154,185,194,66,12,254,224,227,105,80,121,46,99,180,0,94,216,58,106,104,189,4,67,236,109,228,141,179,218,138,247,45,143,245,183,65,110,35,120,40,75,44,56,67,236,143,127,207,122,193,47,49,44,13,174,32,61,144,168,45,106,11,235,120,56,192,204,144,144,175,164,195,42,14,11,197,159,131,167,7,107,139,210,47,194,19,43,203,242,4,195,7,96,26,50,154,7,110,14,11,31,204,39,30,69,14,219,104,99,7,78,45,77,174,164,39,162,10,186,
|
||||
224,153,208,102,109,82,101,97,18,84,236,186,236,209,179,117,235,209,168,43,128,53,28,40,87,151,115,12,162,33,160,98,4,9,156,20,238,107,75,247,146,116,143,171,81,226,198,42,155,54,253,247,63,121,114,60,249,254,172,236,14,45,150,232,248,208,93,38,109,85,140,172,191,228,77,5,40,177,21,209,30,181,140,107,120,95,107,140,158,86,236,155,201,29,7,37,235,223,207,118,57,185,24,191,122,153,252,57,233,29,150,174,151,251,228,226,253,179,146,228,175,165,76,15,37,211,248,161,86,118,246,223,228,108,104,233,80,249,134,45,160,43,223,200,217,0,28,240,251,77,238,12,107,187,164,32,209,38,239,127,109,255,6,73,11,137,242,118,86,180,214,190,166,219,84,62,155,125,3,23,14,14,251,
|
||||
120,156,133,82,95,111,211,48,16,255,42,199,24,168,209,218,172,32,193,3,125,154,214,62,76,154,64,26,29,18,170,42,226,56,151,216,204,177,45,251,210,144,1,223,157,115,194,84,84,132,136,242,16,199,246,239,239,237,224,252,124,57,95,62,95,254,231,121,183,198,90,116,134,246,187,239,95,126,190,216,188,95,220,127,132,93,92,174,244,171,183,203,213,135,215,43,184,143,8,215,20,76,113,177,21,37,144,3,57,72,131,64,42,184,174,81,4,181,54,24,115,216,42,29,129,95,143,65,9,31,121,31,161,117,145,160,139,88,193,3,14,160,109,250,169,43,124,246,114,63,49,188,57,50,92,25,42,46,110,177,166,196,80,156,5,164,46,216,226,44,173,116,235,93,32,97,9,188,17,18,35,204,48,111,114,232,21,6,132,193,117,160,196,1,161,15,154,8,45,68,215,34,41,109,155,44,63,2,223,233,164,244,15,237,73,232,4,86,187,208,139,80,229,39,154,54,81,142,162,165,113,49,81,10,91,65,64,231,209,198,108,244,86,58,34,215,130,23,22,97,214,107,82,32,93,235,
|
||||
181,17,164,157,229,163,145,51,141,128,36,243,60,207,78,192,239,80,178,159,166,51,34,64,105,156,124,136,32,216,139,144,164,15,130,56,174,114,0,207,16,145,109,192,213,237,54,41,57,21,248,153,141,75,97,153,213,15,83,7,48,155,106,186,78,73,199,33,18,182,227,6,180,194,138,6,195,252,119,141,159,210,254,86,225,205,122,147,241,39,167,66,248,141,160,210,129,101,153,33,135,155,154,155,11,41,38,198,79,26,24,99,4,226,212,216,155,52,218,151,142,51,155,131,48,102,186,204,59,44,68,227,95,57,174,131,104,154,100,99,4,112,137,109,162,134,49,75,208,196,217,70,110,156,213,122,238,59,29,203,78,65,142,35,120,153,74,84,60,67,156,143,251,202,122,193,29,48,28,52,246,80,44,210,168,213,157,129,167,241,176,128,149,166,68,222,167,27,70,240,176,80,252,55,120,177,120,138,168,248,145,120,162,55,44,47,97,184,0,76,67,90,178,225,225,82,185,160,31,217,74,90,228,251,253,47,146,132,34,228,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue