[type_index] type names string cross-platformness

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[type_index] type names string cross-platformness

Boost - Dev mailing list
Dear Boost,

MSVC differs from GCC & Clang in the way it present the pretty_name of a
type_info within Type Index.

Indeed for the following type : struct why {};

Is presented as `struct why` while on GCC it is `why`.

Is there any reason why pretty_name wouldn't strip / add the information
from one of the compiler in order to reach a cross-plaftorm string name
of types ?

MSVC:http://rextester.com/QNMB58390 <http://rextester.com/QNMB58390>

GCC: http://coliru.stacked-crooked.com/a/1aa52003605d4936

Would such a patch to the library be possible & welcome ?
Best regards,

--
Damien Buhl
Software Developer
+33 6 77 43 10 05


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [type_index] type names string cross-platformness

Boost - Dev mailing list
On 12/05/17 17:46, Damien Buhl via Boost wrote:

> Dear Boost,
>
> MSVC differs from GCC & Clang in the way it present the pretty_name of a
> type_info within Type Index.
>
> Indeed for the following type : struct why {};
>
> Is presented as `struct why` while on GCC it is `why`.
>
> Is there any reason why pretty_name wouldn't strip / add the information
> from one of the compiler in order to reach a cross-plaftorm string name
> of types ?
>
> MSVC:http://rextester.com/QNMB58390 <http://rextester.com/QNMB58390>
>
> GCC: http://coliru.stacked-crooked.com/a/1aa52003605d4936
>
> Would such a patch to the library be possible & welcome ?
> Best regards,

I think any attempt to make the type names portable/compatible is futile
and only adds overhead that is otherwise useless. IMHO, the library
should return the name as the underlying compiler/ABI does, with no
attempt to post-process it beyond demangling.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost