- Main Page
- Namespaces
- Classes
- Files

# sequence.hpp

Go to the documentation of this file.

    00001
    00003 #ifndef SEQUENCE_HPP_
    00004 #define SEQUENCE_HPP_
    00005
    00007 class sequence
    00008 {
    00009 public:
    00013   sequence(int start = 0, int step = 1) : value_(start), step_(step) {}
    00015   int operator()()
    00016   {
    00017     int result(value_);
    00018     value_ = value_ + step_;
    00019     return result;
    00020   }
    00021 private:
    00022   int value_;
    00023   int const step_;
    00024 };
    00025
    00026 #endif