|
From: Luigi B. <lui...@gm...> - 2009-04-16 16:13:31
|
On Thu, 2009-04-16 at 14:56 +0000, na...@us... wrote: > Revision: 16174 > http://quantlib.svn.sourceforge.net/quantlib/?rev=16174&view=rev > Author: nando > > Log Message: > ----------- > - added static Event::hasOccurredFunction to encapsulate the hasOccurred logic to be used also by non-Event object If it's generic logic, it shouldn't be in the Event class, even as a static method. Then again, if you want to use it somewhere else, it's probably a sign that something else should be inherited from Event and is currently missing. > - modified Event:Date() to return a const reference This doesn't give you anything (allocating a reference is just as costly as allocating a Date on the stack, since Date only contains a long. Any number of methods doesn't make a class any more heavier to instantiate) and forces any Event class to store the date, thus preventing it from calculating the date on the fly. In short, I'd revert the whole changeset, at least until we think a bit more about it. Objections? Luigi -- Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away. -- Antoine de Saint-Exupery |