
"David Abrahams" <dave@boost-consulting.com> wrote
"Andy Little" <andy@servocomm.freeserve.co.uk> writes:
"David Bergman" <davidb@home.se> wrote
David A. wrote:
"Andy Little" <andy@servocomm.freeserve.co.uk> writes:
[snip]
Surely a trait is *part of the *definition* * of an *entity* in a wider sense.
I think I just quite definitively disagreed with that assertion already ;^)
Would you disagree with Andy even if that "wider sense" was a GP concept?
I guess that David Abrahams is taking me to task on use of the word 'entity' which is defined in the standard (3-3).
No, I'm not. Just read the words I wrote. I simply reject the idea that a trait specialization is part of the definition of the type(s) it applies to.
hmm ..From the latest qualifications of your objections above I now assume you are seeing this. struct traits<T> { ... }; Where traits is the subject, traits<T> is Not part of T's definition. But we have been discussing numeric::converter and std::basic_string and differences between traits and policies... I have been seeing this : template <typename T> struct T1{ typedef traits<T> arg_traits; }; Where T1 is the subject, traits<T> Is part of T1's definition. Also see standard 21-2 relating to strings. " <strings> ..need a set of related types... to complete the definition of their semantics". ----------- The traits or policy discussion seems to boil down to this: In T1 above arg_traits is not user modifiable, However template <typename T,typename P> struct T2{ typedef P arg_traits; }; arg_traits in T2 is user-modifiable. traits<T> is a traits-class, but traits<T> could theoretically be used in T2, in which case it would be regarded as implementing a policy. To implement various policies one can define different traits-classes on the same type, however they might then be best referred to as policy-classes. Use of traits<T> in T1 could also be regarded as a policy, but an immutable one. Based on that one could say that a policy is implemented, simply the Use of a traits-class or a policy-class. The term policy being useful only if the policy is modifiable. regards Andy Little