Content deleted Content added
No edit summary |
→Maintaining state: Prefer values to references (and use const where possible) |
||
Line 140:
class CountFrom {
public:
CountFrom(int
int operator()() { return count_++; }
private:
int
};
int main() {
const int state(10);
std::generate_n(std::ostream_iterator<int>(std::cout, "\n"), 11,
CountFrom(state));
|