Basile Starynkevitch <bas...@starynkevitch.net> writes: > * I don't know exactly what should be wished with respect to templates. > Tom Tromey (in CC) have a wonderful insight in > http://gcc.gnu.org/ml/gcc/2010-06/msg00143.html but I probably did not > understood all the details & the consequences. In particular I don't > understand if the mark method in his example has to be supplied or > generated.
In Tom's interesting idea, we would write the mark function by hand for each C++ type that we use GTY with. One way to make this approach work for plugins would be to write template<typename T> void mark(T& t) { t->mark(); } Then every plugin which invents new garbage collected types would have to define a mark method for them. > What I don't understand is, for GTY-ed template classes, do we really > need to exactly use all the std container, or could we specialize them. We can certainly specialize the containers if it seems desirable. Ian