No way to check precondition for DateTime constructor

General discussion regarding the development of POCO for contributors.
marlowa
Posts: 36
Joined: 19 Jul 2006, 09:02
Location: United_Kingdom

No way to check precondition for DateTime constructor

Postby marlowa » 25 Jul 2006, 00:48

The DateTime constructor requires that the year, month, day etc are for a valid date/time but there is no way for the caller to check that this precondition is satisified. Why not provide a static isValid method. The poco_assert will try to invoke the debugger so the caller (IMO) should not assume that he can catch any assertion that the constructor will throw. So he needs to be able to check the precondition himself.

-Andrew Marlow

guenter
Posts: 1192
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: No way to check precondition for DateTime constructor

Postby guenter » 26 Jul 2006, 08:27

> The DateTime constructor requires that the year, month, day etc are for a valid date/time but there is no way for the caller to check that this precondition is satisified.

ok, isValid() will be in the next release.


Return to “Contributors”

Who is online

Users browsing this forum: No registered users and 1 guest