On 04/10/2013 12:33 AM, Steven Schveighoffer wrote:
> Well here is another solution

I did consider something like that.  The actual one I have come to after
thinking about it is like this:

struct MySimulation(T)
{
        T[] var;
        T diff = T.max;
        T convergence;
        _bool empty = false;

        auto front() @property
        {
                return var;
        }

        bool empty() @property
        {
                return _empty;
        }

        void popFront()
        {
                if(diff < convergence)
                        _empty = true;
                else
                        // update var and calculate new diff
        }
}

How does this look to people?

Reply via email to