First page Back Continue Last page Graphics
If you need different values that are known at compile time, you could use a template instead:
If you need different values that are known at compile time, you could use a template instead:
- template <int theValue>
- void add (int& elem)
- {
- elem += theValue;
- }
- void f1( )
- {
- vector <int> coll;
- ...
- for_each(coll.begin( ), coll.end( ), add<10>);
- }