idvaluemap, FunctionGroup: consitfy completion methods

This commit is contained in:
Maxime Coste 2013-03-27 14:09:09 +01:00
parent 251f09ff89
commit a437e9488b
2 changed files with 5 additions and 5 deletions

View File

@ -44,15 +44,15 @@ public:
return *group;
}
CandidateList complete_id(const String& prefix, ByteCount cursor_pos)
CandidateList complete_id(const String& prefix, ByteCount cursor_pos) const
{
return m_functions.complete_id(prefix, cursor_pos);
}
CandidateList complete_group_id(const String& prefix, ByteCount cursor_pos)
CandidateList complete_group_id(const String& prefix, ByteCount cursor_pos) const
{
return m_functions.complete_id_if(
prefix, cursor_pos, [](FunctionAndId& func) {
prefix, cursor_pos, [](const FunctionAndId& func) {
return func.second.template target<FunctionGroup>() != nullptr;
});
}

View File

@ -66,7 +66,7 @@ public:
template<typename _Condition>
CandidateList complete_id_if(const String& prefix,
ByteCount cursor_pos,
_Condition condition)
_Condition condition) const
{
String real_prefix = prefix.substr(0, cursor_pos);
CandidateList result;
@ -83,7 +83,7 @@ public:
}
CandidateList complete_id(const String& prefix,
ByteCount cursor_pos)
ByteCount cursor_pos) const
{
return complete_id_if(
prefix, cursor_pos, [](const value_type&) { return true; });