Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2007-06-16 06:44:02


 

>-----Original Message-----
>From: boost-bounces_at_[hidden]
>[mailto:boost-bounces_at_[hidden]] On Behalf Of David A. Greene
>Sent: 16 June 2007 05:07
>To: boost_at_[hidden]
>Subject: Re: [boost] Progress of Boost.SVG_Plot
>
>On Friday 15 June 2007 21:34, Jake Voytko wrote:
>
>> I think if I were going this route (and I'm starting to see
>its merits, but
>> more on that in a second), I would have all "set" functions
>that work in a
>> chaining manner, and if I wanted to extend functionality as
>above, do as
>> follows:
>>
>> void my_settings(svg_plot& plot)
>> {
>> my_plot . set_axis_color()
>> . set_axis_line_width()
>> . set_axis_line_style()
>> // snip
>> }
>
>I've never understood why this kind of syntax is a good idea.
>program_options
>uses it and I think it just confuses new users.
>
>What's the advantage over individual function calls as Phil
>and others have suggested?

Using the .axis_width().axis_color saves typing
(and makes it is more compact and perhaps clearer by grouping things together).

It is entirely optional - novice users can (should?) just use

myplot.axis_width();
myplot.axis_color();
...

Paul


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