# Blitz++ Class Reference: Range

An object of type Range represents an ordered set of uniformly spaced integers. Range objects can be used to initialize vectors, to refer to subvectors, or as operands in a vector expression. Here are some examples:

    Vector<double> x = Range(0,6);         // x = [ 0 1 2 3 4 5 6 ]
    cout << x(Range::all()) << endl              // [ 0 1 2 3 4 5 6 ]
         << x(Range(3,5))   << endl              // [ 3 4 5 ]
         << x(Range(3,Range::toEnd))  << endl    // [ 3 4 5 6 ]
         << x(Range(Range::fromStart,3)) << endl // [ 0 1 2 3 ]
         << x(Range(1,5,2)) << endl;             // [ 1 3 5 ]