From 4f46e5a95fdc1cf76e61e20b96cb26185c48b965 Mon Sep 17 00:00:00 2001 From: zhangyi Date: Thu, 24 Oct 2019 12:54:26 +0800 Subject: [PATCH] eliminate error for old compilers --- src/id_pool.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/id_pool.h b/src/id_pool.h index e009a37..59e8b2c 100644 --- a/src/id_pool.h +++ b/src/id_pool.h @@ -34,9 +34,15 @@ struct id_type : id_type<0, AlignSize> { template class id_pool { + + static constexpr std::size_t limited_max_count() { + return ipc::detail::min(large_msg_cache, (std::numeric_limits>::max)()); + } + public: enum : std::size_t { - max_count = ipc::detail::min(large_msg_cache, (std::numeric_limits>::max)()) + /* eliminate error: taking address of temporary */ + max_count = limited_max_count() }; private: