Well since I have gotten no response, I thought I
would post the purpose of my submission to see if this helped.
Jim
Purpse:
Given:
class Person
{
public :
// Some
interface...
const std::string& GetName ( )
const ;
// ...some more definition
}
;
typedef vector < Person*
> PersonVector ;
typedef
PersonVector::iterator PersonVecIter ;
typedef
PersonVector::const_iterator PersonVecConstIter
;
This library allows you to substitue the following
functor code:
struct LessPersonByName : public
binary_function < PersonVecConstIter , PersonVecConstIter , bool
>
{
bool operator ( )
(
PersonVecConstIter inLHS
,
PersonVecConstIter inRHS
)
{ return inLHS->GetName ( ) <
inRHS->GetName ( ) ;
}
}
//...
sort
( aPersonVec.begin ( ) ,
aPersonVec.end ( )
,
LessPersonByName ( ) )
;
With this:
sort
( aPersonVec.begin ( ) ,
aPersonVec.end ( )
,
LessMemberFunc ( &Person::GetName ) )
;