From 076ac983f40236171acfa6f8726eb79a51184727 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Wed, 2 Mar 2022 17:41:02 -0800 Subject: [PATCH] Do not rely on ADL when invoking std::max_element (#9608) Summary: Certain STLs use raw pointers and ADL does not work for them. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9608 Reviewed By: ajkr Differential Revision: D34583012 Pulled By: riversand963 fbshipit-source-id: 7de6bbc8a080c3e7243ce0d758fe83f1663168aa --- db/external_sst_file_ingestion_job.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/db/external_sst_file_ingestion_job.cc b/db/external_sst_file_ingestion_job.cc index 40b5604d5..16ec558f2 100644 --- a/db/external_sst_file_ingestion_job.cc +++ b/db/external_sst_file_ingestion_job.cc @@ -777,10 +777,11 @@ Status ExternalSstFileIngestionJob::AssignLevelAndSeqnoForIngestedFile( const std::vector& level_files = vstorage->LevelFiles(lvl); const SequenceNumber level_largest_seqno = - (*max_element(level_files.begin(), level_files.end(), - [](FileMetaData* f1, FileMetaData* f2) { - return f1->fd.largest_seqno < f2->fd.largest_seqno; - })) + (*std::max_element(level_files.begin(), level_files.end(), + [](FileMetaData* f1, FileMetaData* f2) { + return f1->fd.largest_seqno < + f2->fd.largest_seqno; + })) ->fd.largest_seqno; // should only assign seqno to current level's largest seqno when // the file fits