
On 1/21/04 5:22 PM, "David Brownell"
I would like an Interval that goes from a min_value to a max_value, where each value is the previous value + N.
I think std::valarray<> has something like this.
For example, the interval {2, 6, 10, 14, 18} has a minimum value of 2, a maximum value of 18, and increments by 4. Given this interval, I would like a function, Foo, that works as follows:
Interval(2, 18, 4) i;
I think the val-array slice goes "start, length, stride", so the values for the slice object would be (2, 5, 4).
i.Foo(2) == 2 i.Foo(6) == 2 i.Foo(0) == 2 i.Foo(18) == 18 i.Foo(20) == 18 i.Foo(5) == 6 i.Foo(3) == 6 [TRUNCATE]
What problem are you trying to solve? Also, I can't see any pattern for the "Foo" function. -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com