
"David Abrahams" <dave@boost-consulting.com> wrote in message news:uptaqlaqz.fsf@boost-consulting.com...
"Gennadiy Rozental" <gennadiy.rozental@thomson.com> writes:
A trait is a part of the definition of an entity.
That's right.
Absolutely not. A key trait of traits is that they're non-intrusive. They create an association with that can be defined *after* the type argument is defined.
Surely a trait is *part of the *definition* * of an *entity* in a wider sense. (perhaps *definition* has wrong connotations) A type declaration may be *one part * of a larger *entity* including it and (for example) its operations, traits are parts of the wider entity too. traits mechanism is one mechanism for associating parts of the wider entity. (Another is function params via ADL etc) But the root of the problem/thread is exactly what is a trait , or traits and what is a policy. ie to try to come up with an ambiguous specification of the word trait ,traits and policy in a C++ context. FWIW A trait for an entity is used to describe a feature of the entity, usually by parameterising the entity or some type involved in the entity via a traits mechanism. (The traits mechanism associates an entity (usually a type) with a particular family of traits ). A policy customises (part of) an entity, usually by providing an (alternative) implementation of (some) functionality of the entity. non UDT examples: sizeof // has characteristics of a trait. Useful but cant change it atexit // has characteristics of a policy. Usually has a default functionality but can customise it regards Andy Little