diff --git a/far/codepage_selection.cpp b/far/codepage_selection.cpp index b44665886b..db8043a0cd 100644 --- a/far/codepage_selection.cpp +++ b/far/codepage_selection.cpp @@ -298,7 +298,7 @@ size_t codepages::GetCodePageInsertPosition(uintptr_t codePage, size_t start, si }; const auto iRange = irange(start, start + length); - const auto Pos = std::find_if(CONST_RANGE(iRange, i) { return GetCodePage(i) >= codePage; }); + const auto Pos = std::ranges::find_if(iRange, [&](size_t const i){ return GetCodePage(i) >= codePage; }); return Pos != iRange.cend()? *Pos : start + length; } diff --git a/far/config.cpp b/far/config.cpp index 0d07a58a17..b22602844f 100644 --- a/far/config.cpp +++ b/far/config.cpp @@ -2665,7 +2665,7 @@ bool Options::AdvancedConfig(config_type Mode) items.reserve(CurrentConfig.size()); std::vector Strings(CurrentConfig.size()); const auto ConfigData = zip(CurrentConfig, Strings); - std::transform(ALL_CONST_RANGE(ConfigData), std::back_inserter(items), [](const auto& i) { return std::get<0>(i).MakeListItem(std::get<1>(i)); }); + std::ranges::transform(ConfigData, std::back_inserter(items), [](const auto& i) { return std::get<0>(i).MakeListItem(std::get<1>(i)); }); FarList Items{ sizeof(Items), items.size(), items.data() }; diff --git a/far/encoding.cpp b/far/encoding.cpp index d6d14b928e..6402753396 100644 --- a/far/encoding.cpp +++ b/far/encoding.cpp @@ -1742,7 +1742,7 @@ TEST_CASE("encoding.ucs2-utf8.round-trip") const irange Chars(std::numeric_limits::max() + 1); - const auto AllValid = std::all_of(ALL_CONST_RANGE(Chars), [&](wchar_t const Char) + const auto AllValid = std::ranges::all_of(Chars, [&](wchar_t const Char) { const auto Result = round_trip(Char); @@ -1783,7 +1783,7 @@ TEST_CASE("encoding.utf8-ucs2.round-trip") const irange Bytes(std::numeric_limits::max() + 1); - const auto AllValid = std::all_of(ALL_CONST_RANGE(Bytes), [&](char const Byte) + const auto AllValid = std::ranges::all_of(Bytes, [&](char const Byte) { if (!(Byte & 0b10000000) || utf8::support_embedded_raw_bytes) { diff --git a/far/findfile.cpp b/far/findfile.cpp index 7d66974694..c031b1c42e 100644 --- a/far/findfile.cpp +++ b/far/findfile.cpp @@ -518,7 +518,7 @@ void background_searcher::InitInFileSearch() { // Проверяем наличие выбранных страниц символов const auto CpEnum = codepages::GetFavoritesEnumerator(); - const auto hasSelected = std::any_of(CONST_RANGE(CpEnum, i) { return i.second & CPST_FIND; }); + const auto hasSelected = std::ranges::any_of(CpEnum, [](auto const& i){ return (i.second & CPST_FIND) != 0; }); if (hasSelected) { @@ -710,7 +710,7 @@ intptr_t FindFiles::MainDlgProc(Dialog* Dlg, intptr_t Msg, intptr_t Param1, void { const int TitlePosition = 1; const auto CpEnum = codepages::GetFavoritesEnumerator(); - const auto Title = msg(std::any_of(CONST_RANGE(CpEnum, i) { return i.second & CPST_FIND; })? lng::MFindFileSelectedCodePages : lng::MFindFileAllCodePages); + const auto Title = msg(std::ranges::any_of(CpEnum, [](auto const& i){ return i.second & CPST_FIND; })? lng::MFindFileSelectedCodePages : lng::MFindFileAllCodePages); Dlg->GetAllItem()[FAD_COMBOBOX_CP].ListPtr->at(TitlePosition).Name = Title; FarListPos Position{ sizeof(Position) }; Dlg->SendMessage(DM_LISTGETCURPOS, FAD_COMBOBOX_CP, &Position); diff --git a/far/string_utils.cpp b/far/string_utils.cpp index aac240bb5c..a36bb50747 100644 --- a/far/string_utils.cpp +++ b/far/string_utils.cpp @@ -309,14 +309,14 @@ string_view detail::fuzzy_searcher_impl::normalize(string_view const Str) } zip const Zip(m_Result, m_Types); - const auto End = std::remove_if(ALL_RANGE(Zip), [](const auto& i) + const auto Removed = std::ranges::remove_if(Zip, [](const auto& i) { return !flags::check_any(std::get<1>(i), C3_ALPHA | C3_LEXICAL) && flags::check_any(std::get<1>(i), C3_NONSPACING | C3_DIACRITIC | C3_VOWELMARK); }); - m_Result.resize(End - Zip.begin()); + m_Result.resize(m_Result.size() - Removed.size()); return m_Result; }