N
nin234ATIyahoo.com
Here is a stripped down version of what I am trying to do. I would like
to know how to use this template member function
class B
{
int b;
public:
B() {};
template<class DbTags, class DbNams> int getTgs(int &, DbTags&,
DbNams&);
};
template<class DbTags, class DbNams> int B::getTgs(int& a, DbTags& oTg,
DbNams& oNm)
{
typename DbTags::iterator ip;
typename DbNams::iterator in;
for (ip = oTg.begin(); ip != oTg.end(); ip++)
std::cout << (*ip) << std::endl;
//copy (oTg.begin(), oTg.end(),
std:stream_iterator<int>(std::cout));
for (in = oNm.begin(); in != oNm.end(); in++)
std::cout << (*in) << std::endl;
}
template<class DbTg> class A
{
int a;
public:
A();
};
template<class DbTg> A::A()
{
B myB;
int f=9;
DbTg oT;
DbNams oN;
oN.push_back("irq_time");
oN.push_back("irq_wait");
oT.push_back(5);
oT.push_back(6);
myB.getTgs(f, oT, oN);
}
int main()
{
A<std::list<int> > myA;
}
My question is how to use B::getTgs in the constructor A. When the
B::getTgs has the first two arguments only I am able to use it. It is
the third argument that is creating the problem
Regards
Ninan
to know how to use this template member function
class B
{
int b;
public:
B() {};
template<class DbTags, class DbNams> int getTgs(int &, DbTags&,
DbNams&);
};
template<class DbTags, class DbNams> int B::getTgs(int& a, DbTags& oTg,
DbNams& oNm)
{
typename DbTags::iterator ip;
typename DbNams::iterator in;
for (ip = oTg.begin(); ip != oTg.end(); ip++)
std::cout << (*ip) << std::endl;
//copy (oTg.begin(), oTg.end(),
std:stream_iterator<int>(std::cout));
for (in = oNm.begin(); in != oNm.end(); in++)
std::cout << (*in) << std::endl;
}
template<class DbTg> class A
{
int a;
public:
A();
};
template<class DbTg> A::A()
{
B myB;
int f=9;
DbTg oT;
DbNams oN;
oN.push_back("irq_time");
oN.push_back("irq_wait");
oT.push_back(5);
oT.push_back(6);
myB.getTgs(f, oT, oN);
}
int main()
{
A<std::list<int> > myA;
}
My question is how to use B::getTgs in the constructor A. When the
B::getTgs has the first two arguments only I am able to use it. It is
the third argument that is creating the problem
Regards
Ninan