From 05205587f249d7a1da0258d58a81a2ba18948b40 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 3 Sep 2026 23:33:13 +0800 Subject: [PATCH] Give uncast() external linkage for C++20 modules compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `uncast()` is declared `static`, giving it internal linkage, which makes it a TU-local entity per [basic.link]. A TU-local entity declared in a header can easily turn any declaration that names it ([basic.link]/14) into an exposure — which [basic.link]/17 makes ill-formed in a module interface unit or module partition, and deprecated in any other context. --- include/boost/intrusive/detail/uncast.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/intrusive/detail/uncast.hpp b/include/boost/intrusive/detail/uncast.hpp index 7db97b74..13e650de 100644 --- a/include/boost/intrusive/detail/uncast.hpp +++ b/include/boost/intrusive/detail/uncast.hpp @@ -40,7 +40,7 @@ struct uncast_types }; template -static typename uncast_types::non_const_pointer +typename uncast_types::non_const_pointer uncast(const ConstNodePtr & ptr) { return uncast_types::non_const_traits::const_cast_from(ptr);