File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,14 +129,16 @@ namespace QuantLib {
129129 new AverageBMACouponPricer));
130130 }
131131
132- Date AverageBMACoupon::fixingDate () const {
133- QL_FAIL (" no single fixing date for average-BMA coupon" );
134- }
135-
136132 std::vector<Date> AverageBMACoupon::fixingDates () const {
137133 return fixingSchedule_.dates ();
138134 }
139135
136+ Date AverageBMACoupon::fixingDate () const {
137+ QL_REQUIRE (fixingSchedule_.dates ().size () >= 2 ,
138+ " AverageBMACoupon::fixingDate(): expected at least 2 dates in fixing schedule" );
139+ return *std::next (fixingSchedule_.dates ().end (), -2 );
140+ }
141+
140142 Rate AverageBMACoupon::indexFixing () const {
141143 QL_FAIL (" no single fixing for average-BMA coupon" );
142144 }
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ namespace QuantLib {
5656
5757 // ! \name FloatingRateCoupon interface
5858 // @{
59- // ! not applicable here; use fixingDates() instead
59+ // ! the date when the coupon is fully determined
6060 Date fixingDate () const override ;
6161 // ! fixing dates of the rates to be averaged
6262 std::vector<Date> fixingDates () const ;
You can’t perform that action at this time.
0 commit comments