I have arrays like:
template<class T> class F
{
...
bool isSet() { return set_; }
T& GetVal() { return val_; }
private:
T val_;
bool set_;
...
}
F<S1> arr1[10];
I'm looking for an iterator (or iterator-like class) to simplify the following:
F<S1>* cur = arr1[0];
while(cur.IsSet())
{
S1* ptr = cur->GetVal();
// do something with ptr
cur++;
};
Would like something a bit cleaner that can work with different types S1, S2, etc..