function_ref_base: honor the RO5

I'm not entirely sure why function_ref_base declares its destructor. I
guess it's declared in order to make it protected, because the class is
non-polymorphic and inherited by function_ref, and one may want to avoid
slicing. On the other hand, function_ref_base is an implementation
detail, living in a `detail` namespace; so that sounds very unlikely.

In any case, the class is clearly meant to be copiable, so add back
(as protected) the missing special members.

Pick-to: 6.8 6.5
Change-Id: Ibf909e1746e65eecf8b8990839a6e4c9eb56ca13
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 74b875641f40b15a4a59a0c55cd79c251b49c05e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Giuseppe D'Angelo 2025-01-08 14:57:04 +01:00 committed by Qt Cherry-pick Bot
parent 8c8dfce81e
commit ac7ff59b6a

View File

@ -73,6 +73,10 @@ class function_ref_base
{
protected:
~function_ref_base() = default;
function_ref_base(const function_ref_base &) = default;
function_ref_base(function_ref_base &&) = default;
function_ref_base &operator=(const function_ref_base &) = default;
function_ref_base &operator=(function_ref_base &&) = default;
using BoundEntityType = detail::BoundEntityType<Const>;