C++ Logo

std-proposals

Advanced search

Re: std::any for non-copyable types

From: Avi Kivity <avi_at_[hidden]>
Date: Thu, 28 May 2020 16:54:10 +0300
Such a type would be very useful for us. We make extensive use of
move-only types (and have a noncopayble_function template). I would
welcome a standard noncopyable any.

On 28/05/2020 16.41, Antony Polukhin via Std-Proposals wrote:
> Hi,
>
> Is there a proposal for std::any like type that does not require held
> types to be copyable and has unique ownership of the held data?
>
> Is there interest in such class?
>
> We have an in house implementation that I find very useful for storing
> structures that contain unique_ptr (Flatbuffers, recursive types) and
> even non-movable types with mutexes.
>

Received on 2020-05-28 08:57:20