Boost logo

Boost :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2004-11-18 12:20:21


Dave, Daniel,

I have a use case which would be nice to support. I have some functions
which take some number of flag arguments, akin to:

void foo(const char * name, float value, bool flag1 = false, bool flag2
= false)
{
     std::cout << name << " = " << value << "\n";
}

And I can add the named arg interface, so I can use it as:

     foo((value = 5.2f, name = "baz", flag1 = true));

But ideally I'd like the use to look like:

     foo((value = 5.2f, name = "baz", flag1));

That is, the presence of the keyword is enough to set the argument to
true. Possible?

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk