"Doug Gregor" <[EMAIL PROTECTED]> writes:

[...]

| > | For instance, say we have built the types T* and
| > | U* before seeing that same-type constraint. Now, we also need
| > | TYPE_CANONICAL (T*) == TYPE_CANONICAL (U*).
| > | And TYPE_CANONICAL(LessThanComparable<T>) ==
| > | TYPE_CANONICAL(LessThanComparable<U>).
| > | If you know about all of these other types that have been built from T
| > | and U, you can use Nelson and Oppen's algorithm to update the
| > | TYPE_CANONICAL information relatively quickly. If you don't have that
| > | information...
| >
| > In a template definition, one has that information.
| 
| ?
| 
| Our same-type constraint says SameType<T, U>.
| 
| We can easily set TYPE_CANONICAL for T and U.
| 
| We also need to set the TYPE_CANONICAL fields of LessThanComparable<T>
| and LessThanComparable<U> to the same value.
| 
| How do we get from 'T' to 'LessThanComparable<T>'?


Delay semantics processing (that is canonical types, etc.) until you
have build all of the constraint set -- that is basically what we do
for C++98 and C++03 templates. 

At the end of the definition declaration, you have enough needed to 
unify the canonical type nodes for T*, U*, LessThanComparable<T>, etc.

In a sense that is very similar to what we do for definitions that
appear lexically in class definitions.

-- Gaby

Reply via email to