Skip to content

Bump to C++17 #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
project(IndexStoreDB
LANGUAGES C CXX Swift)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ let package = Package(
]),
],

cxxLanguageStandard: .cxx14
cxxLanguageStandard: .cxx17
)
5 changes: 2 additions & 3 deletions lib/Index/IndexDatastore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,13 +1003,12 @@ void UnitMonitor::markOutOfDate(OutOfDateFileTriggerRef trigger,
// Note we have to be careful with the memory management here since the
// key for OutOfDateTriggers is a reference into the stored trigger value.
sys::ScopedLock L(StateMtx);
auto iterAndInserted =
auto [iter, inserted] =
OutOfDateTriggers.try_emplace(trigger->getPathRef(), trigger);
if (!iterAndInserted.second) {
if (!inserted) {
// If we have the same or newer mod time for this trigger already stored,
// we've seen it before, and have already informed the delegate that the
// unit is out of date.
auto iter = iterAndInserted.first;
if (iter->second->getModTime() >= trigger->getModTime())
return;

Expand Down