
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of David A. Greene Sent: 16 June 2007 05:07 To: boost@lists.boost.org 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