The best way I can see (I would like to be proved incorrectly) is to register types in advance, for example:
 #include <typeinfo>  
Possible output:
 4 24 This application has requested the Runtime to terminate it in an unusual way. Please contact the application support team for more information. terminate called after throwing an instance of 'no_such_type' what(): No type l registered 
If you can control the creation of arrays (for example, using the factory method), you can directly register this type here.
 source share