Self-referencing templates
From: Christopher Benson-Manica (ataru_at_nospam.cyberspace.org)
Date: 03/23/04
- Next message: Cy Edmunds: "Re: polymorphism problem: common signatures with no common parent"
- Previous message: Hattuari: "Re: unusing a namespace or #disincluding a header?"
- Next in thread: Leor Zolman: "Re: Self-referencing templates"
- Reply: Leor Zolman: "Re: Self-referencing templates"
- Reply: Siemel Naran: "Re: Self-referencing templates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 23 Mar 2004 15:47:45 +0000 (UTC)
Ugh, I'm having a time wrapping my mind around how this should work.
I have a template class that has a list of objects of another class.
That other class needs a reference to the object that owns it, an
instance of the first class. What's the correct way to declare that?
template class TClientHandler; // supposed to be a forward declaration
// - what's the syntax?
template <class T<T>> // Something?
class TTCPServer
{
friend T; // Does it have to be T<T>? Or what...?
std::vector<T>; // T<T>?
};
template <class T>
class TClientHandler
{
TTCPServer<T<T>> *Owner; // :(
};
Can I not do this? If not, what's the alternative?
-- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
- Next message: Cy Edmunds: "Re: polymorphism problem: common signatures with no common parent"
- Previous message: Hattuari: "Re: unusing a namespace or #disincluding a header?"
- Next in thread: Leor Zolman: "Re: Self-referencing templates"
- Reply: Leor Zolman: "Re: Self-referencing templates"
- Reply: Siemel Naran: "Re: Self-referencing templates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|