G
Gert Van den Eynde
Hi all,
I have a template class
template<typename TC> class A{
public:
...
protected:
TC ObjTC;
}
where my possible TC classes should have a memberfunction double
operator()(double). Somewhere in a memberfunction of A I wish to use
tr1::bind in a call to a memberfunction MF like this
std::tr1::bind(&TC:perator(),ObjTC,_1) which maps to a tr1::function
in the argument list of MF.
but it won't compile: g++ 4.0.2 says that _1 is not defined... Has this
something to do with dependent names in a class? Should I have a
typename somwhere around TC:perator()? Please enlighten me...
thanks,
gert
PS a related question: the possible classes for TC should come from one
hierarchy with an abstract base class. Is there a way to force users of
my code to comply (and not have them using a class that happens to have
a similar interface)?
I have a template class
template<typename TC> class A{
public:
...
protected:
TC ObjTC;
}
where my possible TC classes should have a memberfunction double
operator()(double). Somewhere in a memberfunction of A I wish to use
tr1::bind in a call to a memberfunction MF like this
std::tr1::bind(&TC:perator(),ObjTC,_1) which maps to a tr1::function
in the argument list of MF.
but it won't compile: g++ 4.0.2 says that _1 is not defined... Has this
something to do with dependent names in a class? Should I have a
typename somwhere around TC:perator()? Please enlighten me...
thanks,
gert
PS a related question: the possible classes for TC should come from one
hierarchy with an abstract base class. Is there a way to force users of
my code to comply (and not have them using a class that happens to have
a similar interface)?