Qualify std::map compare functor as const

Some older STL implementations invoke the comparison functor as a const
object, so the function call operator must be 'const' qualified.  This
fixes the commit "Fix support for OLD behavior of policy CMP0002" to
compile on older STLs.
This commit is contained in:
Brad King 2009-09-29 08:34:39 -04:00
parent b0744ad969
commit aa8c003609
2 changed files with 2 additions and 2 deletions

View File

@ -913,7 +913,7 @@ cmGlobalUnixMakefileGenerator3::RecordTargetProgress(
//----------------------------------------------------------------------------
bool
cmGlobalUnixMakefileGenerator3::ProgressMapCompare
::operator()(cmTarget* l, cmTarget* r)
::operator()(cmTarget* l, cmTarget* r) const
{
// Order by target name.
if(int c = strcmp(l->GetName(), r->GetName()))

View File

@ -180,7 +180,7 @@ protected:
std::vector<int> Marks;
void WriteProgressVariables(unsigned long total, unsigned long& current);
};
struct ProgressMapCompare { bool operator()(cmTarget*,cmTarget*); };
struct ProgressMapCompare { bool operator()(cmTarget*,cmTarget*) const; };
typedef std::map<cmTarget*, TargetProgress,
ProgressMapCompare> ProgressMapType;
ProgressMapType ProgressMap;