Matt -
The corrected code is indeed much better. May I suggest using
std::vector instead of vector?
The typedef of FooPtr is fine, it turns out; it's the typedef of struct
Foo that was the problem. I had declared Foo within main as well, and
that blocks the use of boost::shared_ptr on it. As long as Foo is
declared at global scope, all is well.
As for the correct output, my compiler gives me 3, then 2, then 1. I
talked it over with a friend, and I guess the order of the 2 vs 1 is
undefined, and depends on your STL's implementation of std::vector.
As for the crazy aunt in the basement, the comment was meant for an
internal list that only 20-30 people are on, not meant for general
consumption, and probably merits an extra thread by itself. Put simply,
using boost can generate a surprising amount of code and overhead. This
is true of STL as well. There are even some good books describing STL;
I happen to like Plauger/Stepanov/Lee/Musser, as well as Jasoutis. But
nowhere do I see any reference as to what the downsides are - and
nowhere do I see any concise explanation of why an enormous amount of
code (660 bytes in an optimized, no-symbols build) is generated when I
say something as simple as
void Testbed(void) {
boost::function<void> SimpleFPtr(&Testbed);
}
When you say "I was trying to generate interest in these libraries and
thus didn't want to focus too much on the negatives", I can understand
your point of view, but what I see in real life is that people start
using boost::function everywhere they used to use plain old function
pointers, with nary a clue that their code size just exploded with no
benefit.
But like I said, it's worth a whole other thread.
Thanks for fixing the code and responding so quickly!
jorg
-----Original Message-----
From: "Matt S Trentini"
The rest of the pages have the classic boost downfall: they don't discuss any of the pitfalls, performance problems, or code bloat issues, which frankly, seem like the "crazy aunt in the basement" of boost.
I'll defend myself on two fronts. First, it's an introductory presentation - I was trying to generate interest in these libraries and thus didn't want to focus too much on the negatives. Secondly, I _did_ cover some of those points - like all good presentations not everything is contained in the bullet points. Thanks for the feedback though, it's helping to make this presentation better! Cheers, Matt PS If there are any other problems that you or your co-worker have found please don't hesitate to report them! _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users ------ End of Forwarded Message