Hello Everyone,

I would like your opinion on a small addition to the std::shared_ptr:

bool std::shared_ptr::resurrect();

with the following behavior:
Usage scenario:
Code sample:
using SharedMessageT = std::shared_ptr<Message>;
std::promise<SharedMessageT> p;
auto  f = p.get_future();

vector<jthread> thr_vec;
{

    auto sm = std::make_shared<Message>();

    auto lambda = [&p, sm]() mutable {
        doConsume(*sm);

        if (sm.resurrect()) {
            p.set_value(std::move(sm));
        }
    };

    for (size_t i = 0; i < 4; ++i) {
        thr_vec.emplace_back(lambda);
    }
   
    if (sm.resurrect()) {
        p.set_value(std::move(sm));
    }
}
{
    auto sm = f.get();
    doReuse(sm);
}


Similar concept implemented here: https://github.com/solidoss/solidframe/blob/a54ef124ac77c97689c5d9204be35936aaf85c26/solid/utility/sharedbuffer.hpp#L139
And tested here: https://github.com/solidoss/solidframe/blob/a54ef124ac77c97689c5d9204be35936aaf85c26/solid/utility/test/test_shared_buffer.cpp#L36

Thanks,
Valentin Palade