|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2004-04-02 02:31:32
"Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> wrote in message
news:c4ivdk$hgl$1_at_sea.gmane.org...
> [...]
> Trait is specific to the type
> Policy is orthogonal to the type.
> [...]
Where "the type", I presume, is the [template] class using the
policy | trait? That sounds like a good distinction to me. May I
formalize it by proposing that:
1. A trait is a metafunction of the client type.
2. A client type is a metafunction of a policy.
So definition 1 means that a trait is a metafunction which maps a
client type X to a specific trait type trait<X>. Definition 2 means
that a policy client X is a metafunction which maps the client type
to X<policy>. This makes it clear why a policy *class* need not be
a template class. It also shows why a traits *client* need not be a
template class. But I would welcome examples of non-template
traits classes or non-template policy clients.
Now, the definitions I give are necessary but not sufficient
conditions for defining traits and policies. You also need to add
fluff about modifying behavior, yada yada yada.
Dave
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.581 / Virus Database: 368 - Release Date: 2/9/2004
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk