update from Nico

[SVN r10918]
This commit is contained in:
Jens Maurer
2001-08-23 20:33:35 +00:00
parent 7f73413eed
commit f96ac657dd
15 changed files with 65 additions and 49 deletions

View File

@ -12,23 +12,24 @@ int main()
// create and initialize array
array<int,10> a = { { 1, 2, 3, 4, 5 } };
PRINT_ELEMENTS(a);
print_elements(a);
// modify elements directly
for (unsigned i=0; i<a.size(); ++i) {
++a[i];
}
PRINT_ELEMENTS(a);
print_elements(a);
// change order using an STL algorithm
reverse(a.begin(),a.end());
PRINT_ELEMENTS(a);
print_elements(a);
// negate elements using STL framework
transform(a.begin(),a.end(), // source
a.begin(), // destination
negate<int>()); // operation
PRINT_ELEMENTS(a);
return 0;
print_elements(a);
return 0; // makes Visual-C++ compiler happy
}