From 12b9bd0a6def28c1ad69f6f1d5c0096d11ea26fb Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Mon, 26 Sep 2022 15:17:21 -0700 Subject: [PATCH] Fix warnings in internal foa table about float/size_t conversions --- include/boost/unordered/detail/foa.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index a62fd049..e869cbf0 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -627,7 +627,7 @@ public: return arrays.elements?(arrays.groups_size_mask+1)*N-1:0; } - float load_factor()const noexcept{return float(size())/capacity();} + float load_factor()const noexcept{return float(size())/float(capacity());} float max_load_factor()const noexcept{return mlf;} void rehash(std::size_t n) @@ -737,7 +737,7 @@ private: else { float fml=mlf*(float)(capacity()); auto res=(std::numeric_limits::max)(); - if(res>fml)res=(std::size_t)fml; + if(res>(std::size_t)fml)res=(std::size_t)fml; return res; } }