Re: help



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?


.



Relevant Pages

  • Re: set x=nothing
    ... Setting an object to nothing releases the reference ... Dim FSO, Bool ... MsgBox isobject ...
    (microsoft.public.scripting.vbscript)
  • Re: using const & in function prototypes
    ... BOOL func; ... You are passing a reference to an object instead of a copy. ... passing a pointer is at best as performant as passing a DWORD, ...
    (microsoft.public.vc.language)
  • Re: Library Link error.
    ... > That's not the compiler giving the error, it's the linker. ... > reference it in your project. ... >> I do have header file included in the application and the header has the ... >> BOOL Stretch(CDC* pDC, CPoint ptDest, CSize size, BOOL ...
    (microsoft.public.pocketpc.multimedia)
  • Re: Development help
    ... The main reference for automation of MSProject is the ... BOOL CAutoProjectApp::FileOpen(LPCTSTR szFileName, BOOL bReadOnly, BOOL ... COleVariant ReadOnlybReadOnly,VT_BOOL); ... > ReadOnly, const VARIANT& Merge, const VARIANT& TaskInformation, const ...
    (microsoft.public.project)
  • Re: Destructor for const object
    ... For the DbAutoPtr you cannot have the reference count in the pointer. ... What's wrong with const T*? ... > bool isNull() const; ...
    (comp.lang.cpp)

Loading