Skip to content
Snippets Groups Projects
Commit 23e94eed authored by Ben Cumming's avatar Ben Cumming Committed by Sam Yates
Browse files

util::unique_any: a non-copyable util::any (#257)

Add a non-copyable variant of `util::any`.

The two main use cases for such a container are:
 1. Storing types that are not copyable.
 2. Ensuring that no copies are made of copyable types that have to be stored in a type-erased container.                                                                           
                                                                                                          
`unique_any` has the same semantics as `any` with the exception of copy construction and copy assignment, which are explicitly forbidden. The requirement that the contained type be copy-constructable has also been relaxed.

The `any_cast` non-member functions have been overridden for `unique_any`, with the same semantics as for `any`.
parent c2633503
No related branches found
No related tags found
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment