The problem: C++ doesn't allow you to call non-const methods on const objects.
Deep in the MSVS.NET 2k3 source, I found the declartion of bind2nd:
template<class _Fn2,
class _Ty> inline
binder2nd<_Fn2> bind2nd(const _Fn2& _Func, const _Ty& _Right)
{ // return a binder2nd functor adapter
typename _Fn2::second_argument_type _Val(_Right);
return (std::binder2nd<_Fn2>(_Func, _Val));
}
The problem is in this definition, the first paramter is a reference to const. Anything deeper in the call stack from there will believe it's operating on a const object. What's that have to do w/ anything? bool checking::operator() is NOT a const method.
Make checking::operator() const.
Change
bool operator()(const vertex &a,int b)
to
bool operator()(const vertex &a,int b) const
That will let it compile.