From b8196c4a40b72bbd690f9452fee77c12eece7878 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Fri, 27 Sep 2019 11:12:06 +0100 Subject: [PATCH] [7.x][ML] Work around compile error in old Xcode The problem is described in https://stackoverflow.com/questions/7411515/why-does-c-require-a-user-provided-default-constructor-to-default-construct-a Moving construction of the hasher object into the checksum method won't matter in practice as the constructor is a no-op and the object has no data members, so it should get completely optimised away. Backport of #699 --- lib/core/CLoopProgress.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/CLoopProgress.cc b/lib/core/CLoopProgress.cc index 679dd9d6f2..964ae9d419 100644 --- a/lib/core/CLoopProgress.cc +++ b/lib/core/CLoopProgress.cc @@ -22,7 +22,6 @@ const std::string LOOP_SIZE_TAG{"loop_size_tag"}; const std::string PROGRESS_STEPS_TAG{"progress_steps_tag"}; const std::string CURRENT_STEP_PROGRESS_TAG{"current_step_progress_tag"}; const std::string LOOP_POS_TAG{"loop_pos_tag"}; -const std::hash stringHasher; } CLoopProgress::CLoopProgress() @@ -59,6 +58,7 @@ void CLoopProgress::resumeRestored() { std::uint64_t CLoopProgress::checksum() const { std::uint64_t seed{core::CHashing::hashCombine( static_cast(m_Size), static_cast(m_Steps))}; + std::hash stringHasher; seed = core::CHashing::hashCombine( seed, stringHasher(core::CStringUtils::typeToStringPrecise( m_StepProgress, core::CIEEE754::E_DoublePrecision)));