Opened 12 years ago

Closed 12 years ago

#4845 closed Patches (fixed)

end_of_month_day

Reported by: robbie@… Owned by: az_sw_dude
Milestone: To Be Determined Component: date_time
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

the last entry in section: http://www.boost.org/doc/libs/1_44_0/doc/html/date_time/gregorian.html#date_accessors

is incorrect:

date end_of_month_day() const

it should read:

date end_of_month() const

supporting trials:

// call     : $ g++ -ggdb -Wall -pedantic -Weffc++ test.cc -o test
// compiler : g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
// library  : Boost 1.44.0

#include <iostream>                                 // standard io
#include <boost/date_time/gregorian/gregorian.hpp>  // may require -lboost_date_time

int
main()
{
  namespace bg = boost::gregorian;             // namespace aliases
  const bg::date feb(2000, bg::Feb, 1);
  const bg::date eom = feb.end_of_month();     // [1]
//const bg::date eom = feb.end_of_month_day(); // [2]
  const int      dom = eom.day();              // recover day-of-month
  std::cout << "day-of-month : " << dom << std::endl;
}

// [1] works as expected
// [2] test.cc:21: error: 'const class boost::gregorian::date'
//       has no member named 'end_of_month_day

Attachments (2)

date_class.diff (726 bytes ) - added by Katie Chan 12 years ago.
Patch to date_class.diff
date_class.2.diff (726 bytes ) - added by Katie Chan 12 years ago.
Patch to date_class.xml

Download all attachments as: .zip

Change History (17)

comment:1 by Daniel James, 12 years ago

Component: Documentationdate_time
Owner: changed from Matias Capeletto to az_sw_dude

comment:2 by viboes, 12 years ago

This seems fixed in trunk, isn't it?

comment:3 by robbie@…, 12 years ago

I am the original poster. I just checked the following: http://svn.boost.org/svn/boost/trunk/libs/date_time/xmldoc/date_class.xml

And it is still incorrect. Is this what you mean by "fixed in trunk"?

by Katie Chan, 12 years ago

Attachment: date_class.diff added

Patch to date_class.diff

by Katie Chan, 12 years ago

Attachment: date_class.2.diff added

Patch to date_class.xml

comment:4 by Katie Chan, 12 years ago

Type: BugsPatches
Version: Boost 1.44.0Boost Development Trunk

Um, those are the same diff.

comment:5 by robbie@…, 12 years ago

I am the original poster. Looks fixed as far as I can tell. Probably best to mark this one as resolved and I will try to remember to double check the next release. Thanks people.

comment:6 by Katie Chan, 12 years ago

It's not, look at line 339 & line 345 of http://svn.boost.org/svn/boost/trunk/libs/date_time/xmldoc/date_class.xml. Someone with write access to trunk need to commit the changes.

comment:7 by robbie@…, 12 years ago

Original poster here. Regarding comment:6, ktchan is currently correct. (Not sure how I got it wrong in comment:5.)

comment:8 by robbie@…, 12 years ago

Original poster again. http://svn.boost.org/svn/boost/trunk/libs/date_time/xmldoc/date_class.xml is now correct. Does somebody want to change the status of this issue to resolved? I'll try and remember to check the next release. Thanks to all.

comment:9 by Katie Chan, 12 years ago

Erm, no ones made any changes to date_time on trunk for a few months. comment:6 still applies...

comment:10 by robbie@…, 12 years ago

As far as I can tell, http://www.boost.org/doc/libs/1_45_0/doc/html/date_time/gregorian.html remains incorrect. But that http://svn.boost.org/svn/boost/trunk/libs/date_time/xmldoc/date_class.xml is fixed. Why not close this issue then? I promise to check the next release and open a new report if the incorrect function name, end_of_month_day, resurfaces then.

comment:11 by Katie Chan, 12 years ago

Because there's been no changes made to that file since long before 1.45 was released. If as you say, it's incorrect in 1.45, then it's still incorrect.

As I pointed out in comment:6, line 339 & line 345 of that file still have end_of_month_day, so it is not fixed.

comment:12 by robbie@…, 12 years ago

I would like to retract my last comment:10. I just rechecked. The svn copy is still incorrect. Sorry for the confusion (and thanks to ktchan for their patience).

comment:13 by robbie@…, 12 years ago

Original reporter here -- the next release 1.46.0 (http://www.boost.org/doc/libs/1_46_0/doc/html/date_time/gregorian.html#date_time.gregorian.date_class) is out and this typo is still not fixed.

comment:14 by Marshall Clow, 12 years ago

(In [70766]) Applied patches - Refs #3651 Refs #4845

comment:15 by Marshall Clow, 12 years ago

Resolution: fixed
Status: newclosed

(In [70981]) Merge to release. Fixes #3651 Fixes #4845

Note: See TracTickets for help on using tickets.