'recursive' template problem
From: Alexander Stippler (stip_at_mathematik.uni-ulm.de)
Date: 07/16/04
- Next message: sunil: "makedepend issue"
- Previous message: Phlip: "Re: Dynamic Class Loading"
- Next in thread: Marc: "Re: 'recursive' template problem"
- Reply: Marc: "Re: 'recursive' template problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 16 Jul 2004 17:54:47 +0200
Hi,
I have a little problem to design some template classes in a realizable way.
I have some Container classes and some Proxy classes (proxies for
elements). Looks like this:
// P is the Proxy class.
template <typename T, typename P>
class Container
{
P
whatever() { return P(); }
};
template <typename T>
class Proxy1 { ... };
template <typename T>
class Proxy2 { ... };
For some reason every instance of class Proxy needs to know, which Container
class it is used for. Some behavior of Proxy is dependend on the specific
Container. So, when I call method whatever() I want to give the information
that I'm inside Container<T, P> to P. But I cannot give the Proxy class the
information via another template parameter, cause I would end up in an
endless recursive definition, since Container is parameterized by the
Proxy. Got my problem?
Best regards,
alex
- Next message: sunil: "makedepend issue"
- Previous message: Phlip: "Re: Dynamic Class Loading"
- Next in thread: Marc: "Re: 'recursive' template problem"
- Reply: Marc: "Re: 'recursive' template problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|