Skip to content

Conversation

Smertig
Copy link
Contributor

@Smertig Smertig commented Feb 1, 2023

In ReSharper C++ we have our own constexpr evaluation engine. However, getting enumerator or type name with __PRETTY_FUNCTION__ hacks slows down perfomance of its on-the-fly code analysis. For example, resolving of std::array<int, magic_enum::enum_count<SomeEnum>()> requires bruteforcing of all enum names in range [MAGIC_ENUM_RANGE_MIN, MAGIC_ENUM_RANGE_MAX] leading to enormous number of template instantiations and constexpr calculations.

Since upcoming 2023.1 version ReSharper has builtins, that can be used to get type name or enumerator name directly: __rscpp_type_name<T>() and __rscpp_enumerator_name(value). They greatly speed up evaluation of all n<T>() and n<E, V>() internal functions.

@Neargye Neargye merged commit 6527df9 into Neargye:master Feb 1, 2023
@Neargye
Copy link
Owner

Neargye commented Feb 1, 2023

Thanks!

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