9.7. STL___________________________________________________259

  10.3,   :   ,  . 286
         
           -
,       .   
         -
,   .

9.7. STL

   (STL, Standard Template Library)  -
  C++,    -
       .   -
 : ,   ,  
  .

    ,    -
.      ,    -
    C++,   ,  . -
       
 STL.

   ,  STL,    -
,     accumulate () ().

  stl_cont.cpp

//  

#include <iostream>

ttinclude <list> // 

#include <numeric> //  accumulate
using namespace std;

void print(const list<double> &lst)

{         //     1st
list<double>::const_iterator p;

for (p = Ist.beginO; p != lst.end(); ++p)
cout  *p  '\t' ;

cout  endl;

\

int main()
(

double w[4] = { 0.9, 0.8, 88, -99.99 };

list<double> z;

fort int i = 0; i < 4; ++i)
z.push_front(w[i]) ;

print(z) ;

z.sort () ;

print(z);