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. -
-- rrivera/ - grafik/ - 102708583/icq

Boost list run by bdawes at, gregod at, cpdaniel at, john at