Home > database >  boost::typeindex::type_id<>().pretty_name() differences for different systems/compilter/boost-
boost::typeindex::type_id<>().pretty_name() differences for different systems/compilter/boost-

Time:07-07

I am trying to run a project where boost::typeindex::type_id<>().pretty_name() is used to transform the classname to a string, to register it in a factory.

For example class A should transform to "A", class B to "B", etc.

This is working in a Linux gcc environment by using boost::typeindex::type_id<A>().pretty_name().

When I try to run the project in Windows with MSVC 14 and Boost 1.78.0 however class names are transformed in this way:

class A transforms to "class A", class B transforms to "class B", and so on...

Is this because of the OS differences or the compiler differences or some boost parameters or boost version differences?

CodePudding user response:

Boost’s docs state this library is just a wrapper for std::type_info which is purely implementation-dependent, notice how the example on cppreference corresponds to your case.

  • Related