Skip to content

The type in typeid(type) gets replaced by const std::type_info  #522

@Ukilele

Description

@Ukilele

Hello Andreas,
cppinsights transpiles the typeid operator differently, depending on whether you use typeid( type ) or typeid( expression ). When using tyepid( type ), the source type gets replaced by const std::type_info.
It is not a big issue for me, but I suggest keeping the source type (in my example int), if possible.

Source:

#include <typeinfo>
std::type_info const& tiA = typeid(int);
std::type_info const& tiB = typeid(0);

Insight:

#include <typeinfo>
const std::type_info & tiA = typeid(const std::type_info); //<- Here I would suggest to keep "int"

const std::type_info & tiB = typeid(0);

Cheers and thanks a lot for this great tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions