> 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" ) > ;
I showed example out of context. In fact my interface would look like this: cla::parser<...> p; p << ignore_mismatch << named_option( "version" ) << place_to( show_version ) << description( "...") << named_parameter<int>( "trace_level" ) << default_value( 1 ) << place_to( g_trace_level ) << description( "...") ... template<typename T>operator<<( cla::parser<...>, T& ) is the only interface currently supported for both parameters and modifiers. I may consider other propositions. > But anyway, neither of these looks like a huge win over a function > which simply takes 3 parameters. Probably the complexity isn't > justified. There maybe significantly more modifiers for parameter. For example: optional, multiplicable, separator. Now you need to deal with 7 values. Also I in fact believe that my version is simpler, cause only one interface function required. > Dave Abrahams Gennadiy. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost