Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 2836

Show
Ignore:
Timestamp:
11/09/07 22:15:32 (1 year ago)
Author:
schveiguy
Message:

updated for const

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/D2.0/tango/core/Array.d

    r2810 r2836  
    7979     *  The index of the first match or buf.length if no match was found. 
    8080     */ 
    81     size_t find( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     81    size_t find( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    8282 
    8383 
     
    9898     *  The index of the first match or buf.length if no match was found. 
    9999     */ 
    100     size_t find( Elem[] buf, Elem[] pat, Pred2E pred = Pred2E.init ); 
     100    size_t find( const(Elem)[] buf, const(Elem)[] pat, Pred2E pred = Pred2E.init ); 
    101101 
    102102} 
     
    108108 
    109109 
    110         size_t fn( Elem[] buf, Elem pat, Pred pred = Pred.init ) 
     110        size_t fn( const(Elem)[] buf, Elem pat, Pred pred = Pred.init ) 
    111111        { 
    112112            foreach( size_t pos, Elem cur; buf ) 
     
    119119 
    120120 
    121         size_t fn( Elem[] buf, Elem[] pat, Pred pred = Pred.init ) 
     121        size_t fn( const(Elem)[] buf, const(Elem)[] pat, Pred pred = Pred.init ) 
    122122        { 
    123123            if( buf.length == 0 || 
     
    229229     *  The index of the first match or buf.length if no match was found. 
    230230     */ 
    231     size_t rfind( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     231    size_t rfind( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    232232 
    233233 
     
    248248     *  The index of the first match or buf.length if no match was found. 
    249249     */ 
    250     size_t rfind( Elem[] buf, Elem[] pat, Pred2E pred = Pred2E.init ); 
     250    size_t rfind( const(Elem)[] buf, const(Elem)[] pat, Pred2E pred = Pred2E.init ); 
    251251} 
    252252else 
     
    257257 
    258258 
    259         size_t fn( Elem[] buf, Elem pat, Pred pred = Pred.init ) 
     259        size_t fn( const(Elem)[] buf, Elem pat, Pred pred = Pred.init ) 
    260260        { 
    261261            if( buf.length == 0 ) 
     
    273273 
    274274 
    275         size_t fn( Elem[] buf, Elem[] pat, Pred pred = Pred.init ) 
     275        size_t fn( const(Elem)[] buf, const(Elem)[] pat, Pred pred = Pred.init ) 
    276276        { 
    277277            if( buf.length == 0 || 
     
    388388     *  The index of the first match or buf.length if no match was found. 
    389389     */ 
    390     size_t kfind( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     390    size_t kfind( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    391391 
    392392 
     
    412412     *  The index of the first match or buf.length if no match was found. 
    413413     */ 
    414     size_t kfind( Elem[] buf, Elem[] pat, Pred2E pred = Pred2E.init ); 
     414    size_t kfind( const(Elem)[] buf, const(Elem)[] pat, Pred2E pred = Pred2E.init ); 
    415415} 
    416416else 
     
    421421 
    422422 
    423         size_t fn( Elem[] buf, Elem pat, Pred pred = Pred.init ) 
     423        size_t fn( const(Elem)[] buf, Elem pat, Pred pred = Pred.init ) 
    424424        { 
    425425            foreach( size_t pos, Elem cur; buf ) 
     
    432432 
    433433 
    434         size_t fn( Elem[] buf, Elem[] pat, Pred pred = Pred.init ) 
     434        size_t fn( const(Elem)[] buf, const(Elem)[] pat, Pred pred = Pred.init ) 
    435435        { 
    436436            if( buf.length == 0 || 
     
    570570     *  The index of the first match or buf.length if no match was found. 
    571571     */ 
    572     size_t krfind( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     572    size_t krfind( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    573573 
    574574 
     
    594594     *  The index of the first match or buf.length if no match was found. 
    595595     */ 
    596     size_t krfind( Elem[] buf, Elem[] pat, Pred2E pred = Pred2E.init ); 
     596    size_t krfind( const(Elem)[] buf, const(Elem)[] pat, Pred2E pred = Pred2E.init ); 
    597597} 
    598598else 
     
    603603 
    604604 
    605         size_t fn( Elem[] buf, Elem pat, Pred pred = Pred.init ) 
     605        size_t fn( const(Elem)[] buf, Elem pat, Pred pred = Pred.init ) 
    606606        { 
    607607            if( buf.length == 0 ) 
     
    619619 
    620620 
    621         size_t fn( Elem[] buf, Elem[] pat, Pred pred = Pred.init ) 
     621        size_t fn( const(Elem)[] buf, const(Elem)[] pat, Pred pred = Pred.init ) 
    622622        { 
    623623            if( buf.length == 0 || 
     
    752752     *  The index of the first match or buf.length if no match was found. 
    753753     */ 
    754     size_t findIf( Elem[] buf, Pred1E pred ); 
     754    size_t findIf( const(Elem)[] buf, Pred1E pred ); 
    755755} 
    756756else 
     
    761761 
    762762 
    763         size_t fn( Elem[] buf, Pred pred ) 
     763        size_t fn( const(Elem)[] buf, Pred pred ) 
    764764        { 
    765765            foreach( size_t pos, Elem cur; buf ) 
     
    817817     *  The index of the first match or buf.length if no match was found. 
    818818     */ 
    819     size_t rfindIf( Elem[] buf, Pred1E pred ); 
     819    size_t rfindIf( const(Elem)[] buf, Pred1E pred ); 
    820820} 
    821821else 
     
    826826 
    827827 
    828         size_t fn( Elem[] buf, Pred pred ) 
     828        size_t fn( const(Elem)[] buf, Pred pred ) 
    829829        { 
    830830            if( buf.length == 0 ) 
     
    889889     *  The index of the first match or buf.length if no match was found. 
    890890     */ 
    891     size_t findAdj( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     891    size_t findAdj( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    892892 
    893893} 
     
    899899 
    900900 
    901         size_t fn( Elem[] buf, Pred pred = Pred.init ) 
     901        size_t fn( const(Elem)[] buf, Pred pred = Pred.init ) 
    902902        { 
    903903            if( buf.length < 2 ) 
     
    970970     *  True if an element equivalent to pat is found, false if not. 
    971971     */ 
    972     size_t contains( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     972    size_t contains( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    973973 
    974974 
     
    988988     *  True if an element equivalent to pat is found, false if not. 
    989989     */ 
    990     size_t contains( Elem[] buf, Elem[] pat, Pred2E pred = Pred2E.init ); 
     990    size_t contains( const(Elem)[] buf, const(Elem)[] pat, Pred2E pred = Pred2E.init ); 
    991991} 
    992992else 
     
    10721072     * and bufB match, where N = min$(LP)bufA.length, bufB.length$(RP). 
    10731073     */ 
    1074     size_t mismatch( Elem[] bufA, Elem[] bufB, Pred2E pred = Pred2E.init ); 
     1074    size_t mismatch( const(Elem)[] bufA, const(Elem)[] bufB, Pred2E pred = Pred2E.init ); 
    10751075 
    10761076} 
     
    10821082 
    10831083 
    1084         size_t fn( Elem[] bufA, Elem[] bufB, Pred pred = Pred.init ) 
     1084        size_t fn( const(Elem)[] bufA, const(Elem)[] bufB, Pred pred = Pred.init ) 
    10851085        { 
    10861086            size_t  posA = 0, 
     
    11601160     *  The number of elements matching pat. 
    11611161     */ 
    1162     size_t count( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     1162    size_t count( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    11631163 
    11641164} 
     
    11701170 
    11711171 
    1172         size_t fn( Elem[] buf, Elem pat, Pred pred = Pred.init ) 
     1172        size_t fn( const(Elem)[] buf, Elem pat, Pred pred = Pred.init ) 
    11731173        { 
    11741174            size_t cnt = 0; 
     
    12361236     *  The number of elements where pred returns true. 
    12371237     */ 
    1238     size_t countIf( Elem[] buf, Pred1E pred = Pred1E.init ); 
     1238    size_t countIf( const(Elem)[] buf, Pred1E pred = Pred1E.init ); 
    12391239 
    12401240} 
     
    12461246 
    12471247 
    1248         size_t fn( Elem[] buf, Pred pred ) 
     1248        size_t fn( const(Elem)[] buf, Pred pred ) 
    12491249        { 
    12501250            size_t cnt = 0; 
     
    13061306     *  The number of elements replaced. 
    13071307     */ 
    1308     size_t replace( Elem[] buf, Elem pat, Elem val, Pred2E pred = Pred2E.init ); 
     1308    size_t replace( const(Elem)[] buf, Elem pat, Elem val, Pred2E pred = Pred2E.init ); 
    13091309 
    13101310} 
     
    13161316 
    13171317 
    1318         size_t fn( Elem[] buf, Elem pat, Elem val, Pred pred = Pred.init ) 
     1318        size_t fn( const(Elem)[] buf, Elem pat, Elem val, Pred pred = Pred.init ) 
    13191319        { 
    13201320            size_t cnt = 0; 
    13211321 
    1322             foreach( size_t pos, inout Elem cur; buf ) 
     1322            foreach( size_t pos, ref Elem cur; buf ) 
    13231323            { 
    13241324                if( pred( cur, pat ) ) 
     
    13861386     *  The number of elements replaced. 
    13871387     */ 
    1388     size_t replaceIf( Elem[] buf, Elem val, Pred2E pred = Pred2E.init ); 
     1388    size_t replaceIf( const(Elem)[] buf, Elem val, Pred2E pred = Pred2E.init ); 
    13891389 
    13901390} 
     
    13961396 
    13971397 
    1398         size_t fn( Elem[] buf, Elem val, Pred pred ) 
     1398        size_t fn( const(Elem)[] buf, Elem val, Pred pred ) 
    13991399        { 
    14001400            size_t cnt = 0; 
    14011401 
    1402             foreach( size_t pos, inout Elem cur; buf ) 
     1402            foreach( size_t pos, ref Elem cur; buf ) 
    14031403            { 
    14041404                if( pred( cur ) ) 
     
    14501450     * 
    14511451     * Params: 
    1452      *  buf  = The array to scan.  This parameter is not marked 'inout
     1452     *  buf  = The array to scan.  This parameter is not marked 'ref
    14531453     *         to allow temporary slices to be modified.  As buf is not resized 
    1454      *         in any way, omitting the 'inout' qualifier has no effect on the 
     1454     *         in any way, omitting the 'ref' qualifier has no effect on the 
    14551455     *         result of this operation, even though it may be viewed as a 
    14561456     *         side-effect. 
     
    14631463     *  The number of elements that do not match pat. 
    14641464     */ 
    1465     size_t remove( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     1465    size_t remove( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    14661466} 
    14671467else 
     
    15511551     * 
    15521552     * Params: 
    1553      *  buf  = The array to scan.  This parameter is not marked 'inout
     1553     *  buf  = The array to scan.  This parameter is not marked 'ref
    15541554     *         to allow temporary slices to be modified.  As buf is not resized 
    1555      *         in any way, omitting the 'inout' qualifier has no effect on the 
     1555     *         in any way, omitting the 'ref' qualifier has no effect on the 
    15561556     *         result of this operation, even though it may be viewed as a 
    15571557     *         side-effect. 
     
    15631563     *  The number of elements that do not satisfy pred. 
    15641564     */ 
    1565     size_t removeIf( Elem[] buf, Pred1E pred ); 
     1565    size_t removeIf( const(Elem)[] buf, Pred1E pred ); 
    15661566} 
    15671567else 
     
    16441644     * 
    16451645     * Params: 
    1646      *  buf  = The array to scan.  This parameter is not marked 'inout
     1646     *  buf  = The array to scan.  This parameter is not marked 'ref
    16471647     *         to allow temporary slices to be modified.  As buf is not resized 
    1648      *         in any way, omitting the 'inout' qualifier has no effect on the 
     1648     *         in any way, omitting the 'ref' qualifier has no effect on the 
    16491649     *         result of this operation, even though it may be viewed as a 
    16501650     *         side-effect. 
     
    16561656     *  The number of unique elements in buf. 
    16571657     */ 
    1658     size_t unique( Elem[] buf, Pred2E pred = Pred2E.init ); 
     1658    size_t unique( const(Elem)[] buf, Pred2E pred = Pred2E.init ); 
    16591659} 
    16601660else 
     
    17191719      unittest 
    17201720      { 
    1721         void test( char[] buf, char[] pat ) 
     1721        void test( char[] buf, Cutf8 pat ) 
    17221722        { 
    17231723            assert( unique( buf ) == pat.length ); 
     
    17511751     * 
    17521752     * Params: 
    1753      *  buf  = The array to partition.  This parameter is not marked 'inout
     1753     *  buf  = The array to partition.  This parameter is not marked 'ref
    17541754     *         to allow temporary slices to be sorted.  As buf is not resized 
    1755      *         in any way, omitting the 'inout' qualifier has no effect on 
     1755     *         in any way, omitting the 'ref' qualifier has no effect on 
    17561756     *         the result of this operation, even though it may be viewed 
    17571757     *         as a side-effect. 
     
    17631763     *  The number of elements that satisfy pred. 
    17641764     */ 
    1765     size_t partition( Elem[] buf, Pred1E pred ); 
     1765    size_t partition( const(Elem)[] buf, Pred1E pred ); 
    17661766} 
    17671767else 
     
    18541854     * 
    18551855     * Params: 
    1856      *  buf  = The array to partition.  This parameter is not marked 'inout
     1856     *  buf  = The array to partition.  This parameter is not marked 'ref
    18571857     *         to allow temporary slices to be sorted.  As buf is not resized 
    1858      *         in any way, omitting the 'inout' qualifier has no effect on 
     1858     *         in any way, omitting the 'ref' qualifier has no effect on 
    18591859     *         the result of this operation, even though it may be viewed 
    18601860     *         as a side-effect. 
     
    18741874     *  buf.length. 
    18751875     */ 
    1876     size_t select( Elem[] buf, Num num, Pred2E pred = Pred2E.init ); 
     1876    size_t select( const(Elem)[] buf, Num num, Pred2E pred = Pred2E.init ); 
    18771877} 
    18781878else 
     
    19791979     * 
    19801980     * Params: 
    1981      *  buf  = The array to sort.  This parameter is not marked 'inout' to 
     1981     *  buf  = The array to sort.  This parameter is not marked 'ref' to 
    19821982     *         allow temporary slices to be sorted.  As buf is not resized 
    1983      *         in any way, omitting the 'inout' qualifier has no effect on 
     1983     *         in any way, omitting the 'ref' qualifier has no effect on 
    19841984     *         the result of this operation, even though it may be viewed 
    19851985     *         as a side-effect. 
     
    19881988     *         callable type. 
    19891989     */ 
    1990     void sort( Elem[] buf, Pred2E pred = Pred2E.init ); 
     1990    void sort( const(Elem)[] buf, Pred2E pred = Pred2E.init ); 
    19911991} 
    19921992else 
     
    21502150     *  The index of the first match or buf.length if no match was found. 
    21512151     */ 
    2152     size_t lbound( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     2152    size_t lbound( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    21532153} 
    21542154else 
     
    21592159 
    21602160 
    2161         size_t fn( Elem[] buf, Elem pat, Pred pred = Pred.init ) 
     2161        size_t fn( const(Elem)[] buf, Elem pat, Pred pred = Pred.init ) 
    21622162        { 
    21632163            size_t  beg   = 0, 
     
    22342234     *  The index of the first match or buf.length if no match was found. 
    22352235     */ 
    2236     size_t ubound( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     2236    size_t ubound( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    22372237} 
    22382238else 
     
    22432243 
    22442244 
    2245         size_t fn( Elem[] buf, Elem pat, Pred pred = Pred.init ) 
     2245        size_t fn( const(Elem)[] buf, Elem pat, Pred pred = Pred.init ) 
    22462246        { 
    22472247            size_t  beg   = 0, 
     
    23152315     *  True if an element equivalent to pat is found, false if not. 
    23162316     */ 
    2317     bool bsearch( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
     2317    bool bsearch( const(Elem)[] buf, Elem pat, Pred2E pred = Pred2E.init ); 
    23182318} 
    23192319else 
     
    23242324 
    23252325 
    2326         bool fn( Elem[] buf, Elem pat, Pred pred = Pred.init ) 
     2326        bool fn( const(Elem)[] buf, Elem pat, Pred pred = Pred.init ) 
    23272327        { 
    23282328            size_t pos = lbound( buf, pat, pred ); 
     
    23922392     *  true if setA includes all elements in setB, false if not. 
    23932393     */ 
    2394     bool includes( Elem[] setA, Elem[] setB, Pred2E pred = Pred2E.init ); 
     2394    bool includes( const(Elem)[] setA, const(Elem)[] setB, Pred2E pred = Pred2E.init ); 
    23952395} 
    23962396else 
     
    24012401 
    24022402 
    2403         bool fn( Elem[] setA, Elem[] setB, Pred pred = Pred.init ) 
     2403        bool fn( const(Elem)[] setA, const(Elem)[] setB, Pred pred = Pred.init ) 
    24042404        { 
    24052405            size_t  posA = 0, 
     
    24812481     *  A new array containing the union of setA and setB. 
    24822482     */ 
    2483     Elem[] unionOf( Elem[] setA, Elem[] setB, Pred2E pred = Pred2E.init ); 
     2483    const(Elem)[] unionOf( const(Elem)[] setA, const(Elem)[] setB, Pred2E pred = Pred2E.init ); 
    24842484} 
    24852485else 
     
    24902490 
    24912491 
    2492         Elem[] fn( Elem[] setA, Elem[] setB, Pred pred = Pred.init ) 
     2492        Elem[] fn( const(Elem)[] setA, const(Elem)[] setB, Pred pred = Pred.init ) 
    24932493        { 
    24942494            size_t  posA = 0, 
     
    25672567     *  A new array containing the intersection of setA and setB. 
    25682568     */ 
    2569     Elem[] intersectionOf( Elem[] setA, Elem[] setB, Pred2E pred = Pred2E.init ); 
     2569    const(Elem)[] intersectionOf( const(Elem)[] setA, const(Elem)[] setB, Pred2E pred = Pred2E.init ); 
    25702570} 
    25712571else 
     
    25762576 
    25772577 
    2578         Elem[] fn( Elem[] setA, Elem[] setB, Pred pred = Pred.init ) 
     2578        Elem[] fn( const(Elem)[] setA, const(Elem)[] setB, Pred pred = Pred.init ) 
    25792579        { 
    25802580            size_t  posA = 0, 
     
    26492649     *  A new array containing the elements in setA that are not in setB. 
    26502650     */ 
    2651     Elem[] missingFrom( Elem[] setA, Elem[] setB, Pred2E pred = Pred2E.init ); 
     2651    const(Elem)[] missingFrom( const(Elem)[] setA, const(Elem)[] setB, Pred2E pred = Pred2E.init ); 
    26522652} 
    26532653else 
     
    26582658 
    26592659 
    2660         Elem[] fn( Elem[] setA, Elem[] setB, Pred pred = Pred.init ) 
     2660        Elem[] fn( const(Elem)[] setA, const(Elem)[] setB, Pred pred = Pred.init ) 
    26612661        { 
    26622662            size_t  posA = 0, 
     
    27362736     *  and the elements in setB that are not in setA. 
    27372737     */ 
    2738     Elem[] differenceOf( Elem[] setA, Elem[] setB, Pred2E pred = Pred2E.init ); 
     2738    const(Elem)[] differenceOf( const(Elem)[] setA, const(Elem)[] setB, Pred2E pred = Pred2E.init ); 
    27392739} 
    27402740else 
     
    27452745 
    27462746 
    2747         Elem[] fn( Elem[] setA, Elem[] setB, Pred pred = Pred.init ) 
     2747        Elem[] fn( const(Elem)[] setA, const(Elem)[] setB, Pred pred = Pred.init ) 
    27482748        { 
    27492749            size_t  posA = 0, 
     
    28132813     * 
    28142814     * Params: 
    2815      *  buf  = The array to convert.  This parameter is not marked 'inout' to 
     2815     *  buf  = The array to convert.  This parameter is not marked 'ref' to 
    28162816     *         allow temporary slices to be sorted.  As buf is not resized in 
    2817      *         any way, omitting the 'inout' qualifier has no effect on the 
     2817     *         any way, omitting the 'ref' qualifier has no effect on the 
    28182818     *         result of this operation, even though it may be viewed as a 
    28192819     *         side-effect. 
     
    28222822     *         callable type. 
    28232823     */ 
    2824     void makeHeap( Elem[] buf, Pred2E pred = Pred2E.init ); 
     2824    void makeHeap( const(Elem)[] buf, Pred2E pred = Pred2E.init ); 
    28252825} 
    28262826else 
     
    29442944     * 
    29452945     * Params: 
    2946      *  buf  = The heap to modify.  This parameter is marked 'inout' because 
     2946     *  buf  = The heap to modify.  This parameter is marked 'ref' because 
    29472947     *         buf.length will be altered. 
    29482948     *  val  = The element to push onto buf. 
     
    29512951     *         callable type. 
    29522952     */ 
    2953     void pushHeap( inout Elem[] buf, Elem val, Pred2E pred = Pred2E.init ); 
     2953    void pushHeap( ref const(Elem)[] buf, Elem val, Pred2E pred = Pred2E.init ); 
    29542954} 
    29552955else 
     
    29602960 
    29612961 
    2962         void fn( inout Elem[] buf, Elem val, Pred pred = Pred.init ) 
     2962        void fn( ref Elem[] buf, Elem val, Pred pred = Pred.init ) 
    29632963        { 
    29642964            // NOTE: Indexes are passed instead of references because DMD does 
     
    29952995    template pushHeap( Buf, Val ) 
    29962996    { 
    2997         void pushHeap( inout Buf buf, Val val ) 
     2997        void pushHeap( ref Buf buf, Val val ) 
    29982998        { 
    29992999            return pushHeap_!(ElemTypeOf!(Buf)).fn( buf, val ); 
     
    30043004    template pushHeap( Buf, Val, Pred ) 
    30053005    { 
    3006         void pushHeap( inout Buf buf, Val val, Pred pred ) 
     3006        void pushHeap( ref Buf buf, Val val, Pred pred ) 
    30073007        { 
    30083008            return pushHeap_!(ElemTypeOf!(Buf), Pred).fn( buf, val, pred ); 
     
    30663066     * 
    30673067     * Params: 
    3068      *  buf  = The heap to modify.  This parameter is marked 'inout' because 
     3068     *  buf  = The heap to modify.  This parameter is marked 'ref' because 
    30693069     *         buf.length will be altered. 
    30703070     *  pred = The evaluation predicate, which should return true if e1 is 
     
    30723072     *         callable type. 
    30733073     */ 
    3074     void popHeap( inout Elem[] buf, Pred2E pred = Pred2E.init ); 
     3074    void popHeap( ref const(Elem)[] buf, Pred2E pred = Pred2E.init ); 
    30753075} 
    30763076else 
     
    30813081 
    30823082 
    3083         void fn( inout Elem[] buf, Pred pred = Pred.init ) 
     3083        void fn( ref Elem[] buf, Pred pred = Pred.init ) 
    30843084        { 
    30853085            // NOTE: Indexes are passed instead of references because DMD does 
     
    31243124    template popHeap( Buf ) 
    31253125    { 
    3126         void popHeap( inout Buf buf ) 
     3126        void popHeap( ref Buf buf ) 
    31273127        { 
    31283128            return popHeap_!(ElemTypeOf!(Buf)).fn( buf ); 
     
    31333133    template popHeap( Buf, Pred ) 
    31343134    { 
    3135         void popHeap( inout Buf buf, Pred pred ) 
     3135        void popHeap( ref Buf buf, Pred pred ) 
    31363136        { 
    31373137            return popHeap_!(ElemTypeOf!(Buf), Pred).fn( buf, pred ); 
     
    31883188     * 
    31893189     * Params: 
    3190      *  buf  = The heap to sort.  This parameter is not marked 'inout' to 
     3190     *  buf  = The heap to sort.  This parameter is not marked 'ref' to 
    31913191     *         allow temporary slices to be sorted.  As buf is not resized 
    3192      *         in any way, omitting the 'inout' qualifier has no effect on 
     3192     *         in any way, omitting the 'ref' qualifier has no effect on 
    31933193     *         the result of this operation, even though it may be viewed 
    31943194     *         as a side-effect. 
     
    31973197     *         callable type. 
    31983198     */ 
    3199     void sortHeap( Elem[] buf, Pred2E pred = Pred2E.init ); 
     3199    void sortHeap( const(Elem)[] buf, Pred2E pred = Pred2E.init ); 
    32003200} 
    32013201else