Boost logo

Boost :

From: David Turner (dkturner_at_[hidden])
Date: 2004-03-04 10:26:30


Dave Abrahams wrote:
> "David Turner" <dkturner_at_[hidden]> writes:
>>> Hm...maybe I don't understand why it has to be that way?
>> [snip]
>>> why can't we say
>>> window w;
>>> w.add( button( "Click me" ) ); (*)
>> As I explained in an earlier post to Peter Dimov, there are technical
>> reasons why this isn't possible. Widgets have to be rooted in an owning
>> window, and it's not possible to transfer widgets from one window to
>> another. Therefore, button has to take an owner-window parameter in its
>> constructor.
> button("click me") doesn't have to be a widget. Think expression
> templates. It can just build up a type to be used by window to add a
> button.

Interesting. But could this be done in such a way that

button b("click me");

is also acceptable?

David Turner

Boost list run by bdawes at, gregod at, cpdaniel at, john at