Skip to content

[clang-tidy] Check request: boost-use-typeindex-pretty-name #133320

@denzor200

Description

@denzor200

Needs a check that will find not a human-readable print of typeid(T).name() and will suggest to change it to boost::typeindex::type_id<T>().pretty_name().

const std::map<int, int> values;
std::cout << typeid(values).name() << std::endl;                                         // BAD - prints "St3mapIiiSt4lessIiESaISt4pairIKiiEEE"
std::cout << boost::typeindex::type_id<decltype(values)>().pretty_name() << std::endl;   // OK - prints "std::map<int, int, std::less<int>, std::allocator<std::pair<int const, int> > >"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions