• Typesafe storage and safe retrieval of arbitrary types
• A means to store heterogeneous types in Standard Library containers
• Types are being passed through layers that need not know anything about the types
The Any library provides a type,
any, that allows for storage of any type for later retrieval without loss of type safety. It is like a variant type on steroids: It will hold any type, but you have to know the type to retrieve the value. There are times when you need to store unrelated types in the same container. There are times when certain code only cares about conveying data from one point to another without caring about the data's type. At face value, it is easy to do ...