Does someone has knowledge with templates ?
Does someone has knowledge with templates ?
yes.![]()
Do a quick search on google or any other search engine, there are lots of info about it there.
Mikael
hello, i've send you an email, but you seem not having replied.Originally posted by nickels:
yes.![]()
I was just trying to be a funny guy (smart-aleck).
I do know a lot about templates and can offer answers, but I don't have time to jump aboard your project. Too busy climbing rocks and mountains!![]()
hello.
OK. you don't need to climb my project. i only wanted to know why my templates are not working as i want.
Well, you may have to be a little more descriptive. I know that I myself am not telepathic so I can't help much at the moment.
Neil
sorry for the late, but i haven't got the net at home.
I wanted to make generic template classes to avoid redundant implementation of linked list functionalities. My classes are hierarchic, from one mother class. I use polymorphism.
my template implementation is something like this:
template <class O> class list_object
{
O *next;
O *prev;
list_object( ...)
};
template <class O> class list: public list_object
{
// i don't remember here
void AddObject( O data);
void RemoveObject( O data);
};
All seems OK: compilation, linking ( i had errors while linking before, but i correct it). But while executing everything's going bad and worst !
maybe you'll need to see the code ?
Try:
template <class O> class list: public list_object<O>
{
void AddObject( O data);
void RemoveObject( O data);
}
list_object needs to have the template parameter specified.
DN
first, thanks for your care.
(sorry if my english not very good)
But, that's not made any good change.
now, i have to implement the template methods
inner the class definition. that's a wrap !
Now it seems it couldn't create these objects, it seems it overwrite other memory emplacements.
I may go forward each time i try again, but i think i will never succeed.
I would like to know: templates seem to not work if there are preprocessor declaration inner the class. But if the preprocessor declaration is inner the class to match, is it not good too ?
thanks