Re: getting the set of reset dates of a float leg

Posted by Luigi Ballabio-2 on
URL: http://quantlib.414.s1.nabble.com/getting-the-set-of-reset-dates-of-a-float-leg-tp2415p2416.html

At 01:31 PM 2/20/03 +0000, Chak Jack Wong wrote:
>Hi,
>I have got some trouble of getting all the reset dates from a float leg.
>
> From the FloatingRateCouponVector function, I can only get a vector<
>handle< cashflow > > , from which I can get  paydates, but not the reset
>dates.  I can't get this from the floatratecoupon either.

Does the following work?

std::vector<Handle<CashFlow> > v = ...
for (int i=0; i<v.size(); i++) {
     Handle<Coupon> c = v[i]; // assigning a Handle<T> to a Handle<U>
                              // performs a dynamic_cast
     Date start = c->accrualStartDate();
     Date end   = c->accrualEndDate();
     // print them or do whatever you need
}

Or maybe I just didn't get your question?

Later,
         Luigi