Re: [gtk-list] GTK--: (offtopic) How to keep the templates' definiton outside the headers ?



Ionut Borcoman at home <borco@mailbox.ro> writes:
> Please excuse me for this 50% offtopic question ;-).

> Some time ago I read an article about how to separate the implementation
> of the template and its declaration. (Unfortunately, I do not remember
> where I've found that article to read it again.) 

use inheritance to factor out common code out from the template to a 
base class. (think of vector<T> derived privately from void* container)

> The ideea is to convince the compiler to generate all the necessary
> definitions in the object file. Therefore I have this
> bufferedDrawingArea.cc file:

you need to list them explicitely. I think its better to keep as little
implementation inside templates and place the most to a base class...

-- 
-- Tero Pulkkinen -- terop@modeemi.cs.tut.fi --



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]