2
0
mirror of https://github.com/boostorg/compat.git synced 2026-01-19 04:02:16 +00:00

fix erroneous handling of const types in function_ref callable constructor

This commit is contained in:
Christian Mazakas
2024-06-20 11:06:18 -07:00
parent b9f5082f6e
commit 2a5e8031f8

View File

@@ -62,7 +62,7 @@ public:
template <class F>
function_ref_base(obj_tag, F&& fn) noexcept
: thunk_{}, invoke_(&invoke_object_holder<Const, NoEx, F, R, Args...>::invoke_object) {
thunk_.pobj_ = static_cast<void*>(std::addressof(fn));
thunk_.pobj_ = const_cast<void*>(static_cast<void const*>(std::addressof(fn)));
}
function_ref_base(const function_ref_base&) noexcept = default;