
From: "David B. Held" <dheld@codelogicconsulting.com>
"Gennadiy Rozental" <gennadiy.rozental@thomson.com> wrote in message news:c4ivdk$hgl$1@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
No, it is the type for which you need the information or behavior. So, in the case of std::basic_string<T>, "the type" is not std::basic_string<T>, but rather T. (Perhaps that's what you meant, but it isn't what I read.)
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.
That's an interesting way to describe them and I think it fits my model well. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;