Skip to content

Commit f2a41cb

Browse files
authored
Upgrade c++14 to c++17 in cmake (#15073)
1 parent ca1926b commit f2a41cb

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

Firestore/core/src/local/leveldb_remote_document_cache.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ MutableDocumentMap LevelDbRemoteDocumentCache::GetAllExisting(
193193
tasks.AwaitAll();
194194

195195
MutableDocumentMap map;
196-
for (const auto& entry : results.Result()) {
197-
map = map.insert(entry.first, entry.second);
196+
for (const auto& [key, doc] : results.Result()) {
197+
map = map.insert(key, doc);
198198
}
199199
return map;
200200
}

Firestore/core/test/unit/util/iterator_adaptors_test.cc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,14 @@ class IteratorAdaptorTest : public testing::Test {
8282
}
8383

8484
template <typename T>
85-
class InlineStorageIter : public std::iterator<std::input_iterator_tag, T> {
85+
class InlineStorageIter {
8686
public:
87+
using iterator_category = std::input_iterator_tag;
88+
using value_type = T;
89+
using difference_type = std::ptrdiff_t;
90+
using pointer = T*;
91+
using reference = T&;
92+
8793
T* operator->() const {
8894
return get();
8995
}
@@ -567,9 +573,14 @@ TEST_F(IteratorAdaptorTest, IteratorPtrHasRandomAccessMethods) {
567573
EXPECT_EQ(88, value2);
568574
}
569575

570-
class MyInputIterator
571-
: public std::iterator<std::input_iterator_tag, const int*> {
576+
class MyInputIterator {
572577
public:
578+
using iterator_category = std::input_iterator_tag;
579+
using value_type = const int*;
580+
using difference_type = std::ptrdiff_t;
581+
using pointer = const int**;
582+
using reference = const int*;
583+
573584
explicit MyInputIterator(int* x) : x_(x) {
574585
}
575586
const int* operator*() const {

cmake/compiler_setup.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ include(CheckCXXCompilerFlag)
1616

1717
# C++ Compiler setup
1818

19-
# We use C++14
20-
set(CMAKE_CXX_STANDARD 14)
19+
# We use C++17
20+
set(CMAKE_CXX_STANDARD 17)
2121
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2222
set(CMAKE_CXX_EXTENSIONS OFF)
2323

0 commit comments

Comments
 (0)