Skip to content

Conversation

AndreyG
Copy link
Contributor

@AndreyG AndreyG commented Jul 10, 2025

The function type_name is very compiler-dependent, its implementation already contains preprocessor branches for Clang, GCC and MSVC. In ReSharper (it's the plugin for Visual Studio and the language engine used in CLion IDE and Rider) there is the special builtin __rscpp_type_name for getting type name. This builtin is more efficient than extracting text from function signature on the one hand and avoids the need to exactly emulate macros __PRETTY_FUNCTION__/__FUNCSIG__ in all compilers on the other hand.

The similar patch was accepted in another popular open-source C++ library magic_enum few years ago.

Copy link
Owner

@mpusz mpusz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mpusz mpusz merged commit b69df4e into mpusz:master Jul 10, 2025
80 of 83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants