V
Vinu
Hi
I am facing a problem in compilation the error is like this
In constructor
xServices::CServices<TImp>::StHoldClientList::StHoldClientList(std::set<TImp*,
std::less<TImp*>, std::allocator<TImp*> >&)':
: error: expected `;' before "pos"
: error: `pos' undeclared (first use this function)
: error: (Each undeclared identifier is reported only once for each
function it appears in.)
: In destructor
`xServices::CServices<TImp>::StHoldClientList::~StHoldClientList()':
: error: expected `;' before "pos"
: error: `pos' undeclared (first use this function)
Source Code:
namespace xServices
{
template <class TImp>
class CServices
{
protected:
typedef typename std::set<TImp*> ServiceList;
typedef typename ServiceList::iterator ServiceIterator;
ServiceList m_list;
struct StHoldClientList
{
StHoldClientList(ServiceList& clients)
: m_clients(clients)
{
for (CServices::ServiceIterator pos = m_clients.begin(); pos !=
m_clients.end(); ++pos)
(*pos)->AddRef();
}
~StHoldClientList()
{
for (CServices::ServiceIterator pos = m_clients.begin(); pos !=
m_clients.end(); ++pos)
(*pos++)->Release();
}
ServiceList& m_clients;
};
friend struct StHoldClientList;
};
}
Can u help me to solve this error.
Can you suggest standard way of doing it on Sun Solaris Sparc? We are
using gcc 3.4.2 .
Thanks
Vinu
I am facing a problem in compilation the error is like this
In constructor
xServices::CServices<TImp>::StHoldClientList::StHoldClientList(std::set<TImp*,
std::less<TImp*>, std::allocator<TImp*> >&)':
: error: expected `;' before "pos"
: error: `pos' undeclared (first use this function)
: error: (Each undeclared identifier is reported only once for each
function it appears in.)
: In destructor
`xServices::CServices<TImp>::StHoldClientList::~StHoldClientList()':
: error: expected `;' before "pos"
: error: `pos' undeclared (first use this function)
Source Code:
namespace xServices
{
template <class TImp>
class CServices
{
protected:
typedef typename std::set<TImp*> ServiceList;
typedef typename ServiceList::iterator ServiceIterator;
ServiceList m_list;
struct StHoldClientList
{
StHoldClientList(ServiceList& clients)
: m_clients(clients)
{
for (CServices::ServiceIterator pos = m_clients.begin(); pos !=
m_clients.end(); ++pos)
(*pos)->AddRef();
}
~StHoldClientList()
{
for (CServices::ServiceIterator pos = m_clients.begin(); pos !=
m_clients.end(); ++pos)
(*pos++)->Release();
}
ServiceList& m_clients;
};
friend struct StHoldClientList;
};
}
Can u help me to solve this error.
Can you suggest standard way of doing it on Sun Solaris Sparc? We are
using gcc 3.4.2 .
Thanks
Vinu