Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2004-05-14 12:47:53


Ok, suppose we have a policy-based class Foo, and a policy P:

template <typename Policy>
class Foo
{
    // ...
};

struct P
{
    template <typename T>
    struct apply
    {
        typedef policy type;
    };
};

Now, my understanding is that we can use Lambda so that we can
invoke Foo this way:

Foo<P> f;

Or define P in this way:

template <typename T>
struct P
{
    // policy
};

and call Foo this way:

Foo<P<_> > f;

But if I require that everyone define P in the first way, then Lambda
should not be necessary, is that correct? Is there still a reason to
use Lambda in that case?

Dave

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.683 / Virus Database: 445 - Release Date: 5/12/2004

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