|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-03-03 11:37:57
Matthias Schabel wrote:
>
> As far as the demo program :
>
> int main(int argc, char* argv[])
> {
> window w = create_window();
> w->title("Example window");
> w->contain(create_button(w, "Hello, world!"));
> wait_for_signal(w->delete_signal);
> }
>
> why not :
>
> int main(int argc, char* argv[])
> {
> window w("Example window"); // more consistent with button syntax
> below
> w.add(button("Hello, world!")); // no need to have w be a
> pointer?
> w.wait_for(delete_signal());
> }
>
> or something like that.
Many C++ people like shallow copy things to explicitly have a pointer-like
syntax. I, personally, can happily tolerate either.
For an apples to apples comparison,
window w("Example window");
should be compared with
window w = create_window("Example window");
Finally,
w.wait_for( delete_signal() );
just introduces a redundant top-level tag class and a corresponding
redundant window_base overload.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk