Opened 10 years ago

#2805 new Bugs

Add Documentation to Date_Time to Highlight a Pitfall

Reported by: Charles Brockman <cmbrockman@…> Owned by: az_sw_dude
Milestone: Boost 1.39.0 Component: date_time
Version: Boost 1.38.0 Severity: Problem
Keywords: Cc:


A note should be added to the Date_Time documentation to warn programmers of a pitfall in the use of the comparison operators. Comparison of a valid date with not_a_date_time may return an unexpected result. In the expression, date A < date B if A is a valid date and B is not_a_date_time, a Boolean true is returned. A programmer may expect that any comparison of valid date with not_a_date_time always returns false. In some cases it will return true.

In the \libs\date_time\xmldoc\date_class.xml file in the Operator table of the Gregorian Date System section I suggest the following text.

Warning: Some comparisons of valid dates and not_a_date_time will return true. See the \libs\date_time\test\gregorian\testdate.cpp program for illustrations of the comparisons.

The tests for the various comparisons are included in a patch contained in Trac #2804.

Change History (0)

Note: See TracTickets for help on using tickets.