Re: help
- From: paultwa2006@xxxxxxxxx
- Date: 25 Mar 2007 19:59:13 -0700
now , i update my project detail below;
template<typename T1, typename T2>
struct ChannelExist:
public binary_function<T1,T2,bool>{
bool operator()(const T1& lhs,const T2& rhs)const
{
return (lhs->m_lExternalChannelID) == rhs;
}
};
template<typename elementT,typename T>
inline
T::iterator SearchNodePointer(T container,elementT nodeID)
{
//T::iterator findIt =
find_if(container.begin(),container.end(),bind2nd(equal<T::iterator,long>(),nodeID));
T::iterator findIt =
find_if(container.begin(),container.end(),bind2nd(ChannelExist<T::iterator,long>(),nodeID));
return findIt;
}
template<typename elementT,typename T>
inline
BOOL isExistNodePointer(elementT& nodeID,T& container)
{
return ((SearchNodePointer(container,nodeID) != container.end()) ?
true : false);
}
but , the compiler send me error message:
:\program files\microsoft visual studio\vc98\include\algorithm(50) :
error C2664: '()' : cannot convert parameter 1 from 'class CChannel *'
to 'class CChannel **const & '
Reason: cannot convert from 'class CChannel *' to 'class
CChannel **const '
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
\comultiplayer\struct.h(276) : see reference to function
template instantiation 'class CChannel **__cdecl std::find_if(class
CChannel ** ,class CChannel ** ,class std::binder2nd<struct
ChannelExist<class CChannel * *,long> >) ' being compiled
d:\program files\microsoft visual studio\vc98\include\algorithm(50) :
error C2064: term does not evaluate to a function
\comultiplayer\struct.h(276) : see reference to function
template instantiation 'class CChannel **__cdecl std::find_if(class
CChannel ** ,class CChannel ** ,class std::binder2nd<struct
ChannelExist<class CChannel * *,long> >) ' being compiled
why?
.
- References:
- help
- From: paultwa2006
- help
- Prev by Date: help
- Next by Date: Re: help
- Previous by thread: help
- Next by thread: Re: help
- Index(es):
Relevant Pages
|
Loading