|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-03-03 12:56:07
"Peter Dimov" <pdimov_at_[hidden]> writes:
> 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.
Me too.
> For an apples to apples comparison,
>
> window w("Example window");
>
> should be compared with
>
> window w = create_window("Example window");
http://news.gmane.org/find-root.php?message_id=%3cuel05uq5p.fsf%40boost%2dconsulting.com%3e
shows a way to make the first syntax a little easier to produce.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk