-
Notifications
You must be signed in to change notification settings - Fork 26
Type to string conversion utilites #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
499d0bb
to
0b42134
Compare
This looks good to me, as soon as the clang format is done. |
0b42134
to
1e6ebdc
Compare
There is alread a If that approach is accepted to be safer, I'm fine with that. It just returns values like "i" for an "int" on some compilers. EDIT: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #225 +/- ##
===========================================
+ Coverage 65.80% 65.83% +0.02%
===========================================
Files 1131 1133 +2
Lines 57598 57647 +49
Branches 4338 4338
===========================================
+ Hits 37902 37951 +49
Misses 19696 19696 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1e6ebdc
to
1a66266
Compare
Demangle is to make c++ mangled symbols human readable. It is used in the backtraces. That is definitely not your use case. Perhaps you intend or could use typeid from c++ |
typeid would be used together with These are basically the reason why the other approach is commonly more accepted - to get compile time strings. |
Description
This PR provides utilities to convert arbitrary types to strings by calling
typeToString<T>()
.This utility is useful to create detailed error (and log) messages in templated code or to generate
a set of specialized error messages consistently.
A typical usecase is type dispatching with
std::variant
:Contributor Declaration
By opening this pull request, I affirm the following: