I'm having problems compiling the code below with boost_1_30_2 and VC71 complaining about: ...\Microsoft Visual Studio .NET 2003\Vc7\include\xutility(489) : error C2665: 'std::_Distance2' : none of the 4 overloads can convert parameter 4 from type 'std::iterator_traits<_Iter>::iterator_category' with [ _Iter=CDictionary::tVarConstItr ] ... Replacing with std::distance( lBeg.base(), lItr.base() ) does compile and work properly. Am I missing something in the typedef of tVarConstItr that would allow direct usage? ---------------------------------------------------------- class CDictionary { ... class VarSpec { ... typedef boost::shared_ptr<VarSpec> tPtr; }; typedef VarSpec tVar; typedef tVar::tPtr tVarPtr; typedef std::vector<tVarPtr> tVars; typedef boost::indirect_iterator_generator < tVars::const_iterator , tVar , tVar& , tVar* , std::iterator_traitstVars::const_iterator ::iterator_category
::type tVarConstItr;
typedef boost::indirect_iterator_generator < tVars::iterator , tVar , tVar& , tVar* , std::iterator_traitstVars::iterator ::iterator_category
::type tVarItr;
tGroups Groups()const{ return mGroups; }
tVarItr VarBegin() { return tVarItr ( mVars.begin() ); }
tVarItr VarEnd () { return tVarItr ( mVars.end () ); }
tVarConstItr VarBegin()const{ return tVarConstItr( mVars.begin() ); }
tVarConstItr VarEnd ()const{ return tVarConstItr( mVars.end () ); }
};
usage:
------
int CDictionaryEditorView::Idx( const TCHAR* aChrPtr, bool aExact )const
{
boost::function1