Bo Peng wrote:
This makes the use of layout pointers seem kind of fragile. Maybe we
should just store the name of the layout instead, and then use
TextClass::operator[] to find the layout when we need it. There may be other
benefits to doing it that way, too.
If there's no performance problem, that sounds good. But only if the changes
are safe and not too intrusive.
The performance impact will be big because this layout pointer is used
everywhere. Even storing layout index is better than storing their
names.
Using names would mean a map or a hash table (better) instead of a
vector (which could lead to index based access). Maybe the perfomance
impact would not be that big... one has to try.
Anyway, my guess is that if layout pointers are used directly, using
list<Layout> or deque<Layout> should not cause significant performance
problem. JMarc may know more about this LayoutList stuff.
The expert nowadays is Richard ;-)
Abdel.