Change decltype(mapVariable)::value_type → auto (C++14)

This commit is contained in:
Allan Odgaard
2014-03-16 18:05:32 +07:00
parent f3f4efd062
commit af0e6cc643
2 changed files with 3 additions and 3 deletions

View File

@@ -2292,12 +2292,12 @@ static void update_menu_key_equivalents (NSMenu* menu, action_to_key_t const& ac
auto allMatches = ng::find(document->buffer(), editor->ranges(), findStr, options, onlyInSelection ? editor->ranges() : ng::ranges_t(), &didWrap);
ng::ranges_t res;
std::transform(allMatches.begin(), allMatches.end(), std::back_inserter(res), [](decltype(allMatches)::value_type const& p){ return p.first; });
std::transform(allMatches.begin(), allMatches.end(), std::back_inserter(res), [](auto const& p){ return p.first; });
if(onlyInSelection && res.sorted() == editor->ranges().sorted())
{
res = ng::ranges_t();
allMatches = ng::find(document->buffer(), editor->ranges(), findStr, options, ng::ranges_t());
std::transform(allMatches.begin(), allMatches.end(), std::back_inserter(res), [](decltype(allMatches)::value_type const& p){ return p.first; });
std::transform(allMatches.begin(), allMatches.end(), std::back_inserter(res), [](auto const& p){ return p.first; });
}
if(res.empty() && !isCounting && documents && [documents count] > 1)

View File

@@ -1337,7 +1337,7 @@ namespace ng
{
if(options & find::backwards)
{
auto it = std::lower_bound(tmp.begin(), tmp.end(), range, [](decltype(tmp)::value_type const& candidate, ng::range_t const& range){
auto it = std::lower_bound(tmp.begin(), tmp.end(), range, [](auto const& candidate, ng::range_t const& range){
return candidate.first.empty() ? candidate.first.max() < range.min() : candidate.first.max() <= range.min();
});