D
Da Wang
Hi,all,
I am reading the Iterator part of Design Pattern. It defines a basic
Iterator interface as shown below. My question is: what is the use of
the protected constructor? Maybe that does not matter but just in case I
neglect something important.
many thanks.
-------------------------------
template <class Item>
class Iterator {
public:
virtual void First() = 0;
virtual void Next() = 0;
virtual bool IsDone() const = 0;
virtual Item CurrentItem() const = 0;
protected:
Iterator();
};
--
Life is an opportunity to do something.
.-._
o_oo'_)
`._ `._
`, \
//_(_)_/
~~
I am reading the Iterator part of Design Pattern. It defines a basic
Iterator interface as shown below. My question is: what is the use of
the protected constructor? Maybe that does not matter but just in case I
neglect something important.
many thanks.
-------------------------------
template <class Item>
class Iterator {
public:
virtual void First() = 0;
virtual void Next() = 0;
virtual bool IsDone() const = 0;
virtual Item CurrentItem() const = 0;
protected:
Iterator();
};
--
Life is an opportunity to do something.
.-._
o_oo'_)
`._ `._
`, \
//_(_)_/
~~