
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? I'm not passing judgement on the streaming-like interface. Just wondering why "overloading operator.()" is good for anything. -Dave