|
From: Dima <dim...@go...> - 2009-09-23 14:17:48
|
Luigi, I know that you're working on the 1.0 release and it wasn't meant to go into the next release. I just wanted it to be on some to do list - where I'd be happy to contribute. The shortcomings are not bad since it is probably used correctly in the current library. However, some users might use the particular class- as a standalone class- in their own applications and might not know about the mentioned behavior. Also, other contributors might use it without looking into the details and some errors can occurr, in particular in the default constructor comparison. This is why I proposed a temporary fix until we have something better. I'm aware of boost::optional and think it could be the way to go. However, I don't see an easy way to incorporate it in the current Null design. I think it would have to be used directly such as in: boost::optional<double> optVar; QL_REQUIRE(optVar!=NULL,"....."); double var=*optVar; Anyways, you might be busy with more important stuff. If you need help to rewrite classes with boost::optional in the future, let me know. 2009/9/23 Luigi Ballabio <lui...@gm...> > On Fri, 2009-09-18 at 15:58 +0200, Dima wrote: > > > > I had a closer look at it and would like to propose some changes. > > Dima, > I know, Null<> has a number of shortcomings. But rather than trying > to > patch it, I'd replace it with boost::optional<> instead. > > The problem is, we're already late for the 1.0 train. Over the next > releases, I'll try to replace it in a few places where it doesn't break > backward compatibility. For the other places, I guess we'll wait for > the next overhaul (2.0, probably in a few years.) The shortcomings are > not that bad anyway. > > Thoughts? > Luigi > > > -- > > Newton's Law of Gravitation: > What goes up must come down. But don't expect it to come down > where you can find it. Murphy's Law applies to Newton's. > > > |