> I need a library like the boost::variant on Poco (it looks Poco is much more consistent than boost....). Can anyone please suggest anything ?
What we have is Poco~058~~058~Any (basically same as boost~058~~058~any) and Poco~058~~058~))DynamicAny(( (our own creation built on Any foundation). Poco~058~~058~Any will hold any type, built-in or user-defined "out of the box". However, when retrieving the original value, you must know exactly what is contained inside (or engage in querying Any for the type). ))DynamicAny(( differs from Any in that it will implicitly and safely convert anything that can be converted (or throw an exception if it is not). However, it needs specialization for each type held. Poco provides specializations for all PODs, plus std~058~~058~string, std~058~~058~vector (for array-like semantics), ))DateTime((, ))LocalDateTime((, Timestamp, Data~058~~058~BLOB, Data~058~~058~Date and Data~058~~058~Time.
> I believe that the Foundation::Core~058~~058~DynamicAny would do the work but I need some examples of how to use it with user defined types and not the C++ standar built-in types.
There is no significant difference between specialization for built-in and UDT types. There are numerous examples in
DynamicAnyHolder on how to specialize it for built-in (int, double, ...), standard library (std~058~~058~string, std~058~~058~vector) and user defined (DateTime, LocalDateTime, TimeStamp) types. For Poco~058~~058~Data library specializations (BLOB, Date, Time), look in corresponding header files for the mentioned classes.
> Any thought will be welcome.
HTH
Alex