Boost logo

Boost :

From: David Turner (dkturner_at_[hidden])
Date: 2004-03-03 11:01:17


hi

> I'm in full support of your effort. Just a small comment:
>
> int main(int argc, char* argv[])
> {
> window w = create_window();
> w->title("Example window");
>
> why is window implicitly a pointer?

In fact, window is defined thus:

typedef boost::shared_ptr<window_base> window;

The reason is that widgets are always reference-counted. The alternative
would have been to make window a pimpl class, with the impl being
reference counted. However, since I wanted to use the factory pattern to
firewall the implementation of widgets, I would have to have my widgets on
the heap anyway, so I just made widget a shared pointer to the WDT (whole
damn thing).

Does that make sense? :-)

> Adn maybe
>
> 9. It should be possible to create worm-like games in it, where student
> need
> to draw the worm by moving
> pixels or something around :-)

Ha ha, yes.

Regards
David Turner


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk