cmAlgorithms: Add cmReverseRange adaptor.
Use it to implement list(REVERSE).
This commit is contained in:
parent
a3a0a8c222
commit
4afe6c26c6
|
@ -302,4 +302,12 @@ typename Range::const_iterator cmFindNot(Range const& r, T const& t)
|
|||
std::bind1st(std::not_equal_to<T>(), t));
|
||||
}
|
||||
|
||||
template<typename Range>
|
||||
ContainerAlgorithms::Range<typename Range::const_reverse_iterator>
|
||||
cmReverseRange(Range const& range)
|
||||
{
|
||||
return ContainerAlgorithms::Range<typename Range::const_reverse_iterator>(
|
||||
range.rbegin(), range.rend());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -390,8 +390,7 @@ bool cmListCommand
|
|||
return false;
|
||||
}
|
||||
|
||||
std::reverse(varArgsExpanded.begin(), varArgsExpanded.end());
|
||||
std::string value = cmJoin(varArgsExpanded, ";");
|
||||
std::string value = cmJoin(cmReverseRange(varArgsExpanded), ";");
|
||||
|
||||
this->Makefile->AddDefinition(listName, value.c_str());
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue