2007/6/26, Jon Keating <[EMAIL PROTECTED]>:
Useful, but not very C++ like. varargs removes any type checking of parameters to the functions, which makes us rely on printf's formatting that is prone to errors and unsafe by nature. I think using boost::format would be much better than C's varargs and the printf family.
With gcc you actually get type checking on the parameters. A bigger problem is that you can't use anything but primitive data types and, most notable, std::string doesn't work.
Take a look here for more details, the syntax is a bit different, but it provides type checking and is much safer: http://www.boost.org/libs/format/index.html
boost::format looks really nice. +1 for that :)
Plugins shouldn't really be throwing beyond themselves. We should probably specify that in the Plugin documention.
There can be problems catching exceptions thrown from the daemon in the plugins as well. It's not impossible (or even hard) to do, but we need to keep it mind.
I'm pretty sure it is much easier to find examples of when it makes sense than when it doesn't make sense. Using the STL's algorithms techniques makes us code in a way that keeps one function to one task. For example...
Without using boost, it can sometimes be cumbersome to create the functors that you need, instead of using a simple loop. But boost::lambda looks like it might be the answer to all my prayers, so I'm willing to give it a try. // Erik -- Erik Johansson http://ejohansson.se/
