ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: CLA/Config file library opinion
by Vladimir Prus other posts by this author
May 29 2003 6:03AM messages near this date
Re: [boost] RE: an XML API in boost | [boost] Re: CLA/Config file library opinion
David Abrahams wrote:

> >     parameter<std::string>( "output" )
> >       << place_to( output_file_name )
> >       << default_value( "/tmp/abc" )
> >       << description( "output file name" )
>  
>  While I don't find the interface proposed by Vladimir to be offensive,
>  when you get a pile of function arguments of the same type together a
>  named parameter interface *can* be a help.  I don't think I'd use
>  operator<<, though.  If it's really about readability I'd tend to
>  sacrifice some non-intrusive extensibility for a cleaner syntax:
>  
>       parameter<std::string>( "output" )
>         .place_to( output_file_name )
>         .default_value( "/tmp/abc" )
>         .description( "output file name" )
>         ;
>  
>  But anyway, neither of these looks like a huge win over a function
>  which simply takes 3 parameters.  Probably the complexity isn't
>  justified.

And one important point: there are only three unnamed parameters. There's a
bunch of other things that can be configured, and they all use *named*
interface:

   desc.add_options()
       ("output", "file", "output file name").default_value("/tmp/abc")
       ;

- Volodya 


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved