Hi all,
consider the following problem:
// class A declaration
class A
{
virtual void do_one_something() = 0;
};
// class Atemplate declaration
template<class T>
class Atemplate
ublic A
{
public:
void do_one_somenthing(); //implementation is provided
// at other place in code
void getItsxx(T* xx){ xx = itsXX;}
private:
T* itsXX;
}
//Implamentation of a method in class B
void B::do_anything()
{
A* a = getAHandler(); // Get reference to instantiation of A
Atemplate<W>* aTemplate = dynamic_cast<Atemplate<W>*>(a);
W xx;
a->getItsxx(&xx); //I always get a segmentation fault here
}
Can anyone help me on that?? I have also tried to make a static_cast, but the problem persists...
Thanks!!!
consider the following problem:
// class A declaration
class A
{
virtual void do_one_something() = 0;
};
// class Atemplate declaration
template<class T>
class Atemplate
{
public:
void do_one_somenthing(); //implementation is provided
// at other place in code
void getItsxx(T* xx){ xx = itsXX;}
private:
T* itsXX;
}
//Implamentation of a method in class B
void B::do_anything()
{
A* a = getAHandler(); // Get reference to instantiation of A
Atemplate<W>* aTemplate = dynamic_cast<Atemplate<W>*>(a);
W xx;
a->getItsxx(&xx); //I always get a segmentation fault here
}
Can anyone help me on that?? I have also tried to make a static_cast, but the problem persists...
Thanks!!!