$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-11-15 13:35:29
Rene Rivera wrote:
[...]
> #include <boost/named_params.hpp>
> 
> struct name_t; // tag types
> struct value_t;
> 
> namespace {
>     boost::keyword<name_t> name;    // keyword objects
    boost::keyword<struct name_t> name;
is even better. ;-)
>     boost::keyword<value_t> value;
> }
> 
> template<class Params>
> inline void foo(const Params& params)
> {
>     foo(params[name],params[value]);
> }
> 
> int main()
> {
>     foo((name = "bar", value = 3.14f));
>     foo((value = 5.2f, name = "baz"));
> 
>     return 0;
> }
FWIW, I also like this style.