Content deleted Content added
No edit summary |
m →Maintaining state: Improve C++ example |
||
Line 138:
<source lang=Cpp>
#include <algorithm>▼
#include <iostream>
#include <iterator>
▲#include <algorithm>
class CountFrom {
public:▼
private:▼
CountFrom(int
▲public:
▲ private:
int& count_;
};
int main() {
int state(10);
std::generate_n(std::ostream_iterator<int>(std::cout, "\n"), 11,
CountFrom(state)); }
</source>
|