#getting type name at compiletime
27 messages · Page 1 of 1 (latest)
Instead of return ""; you might want to #error for an unsupported compiler
Depending on your design goals / what guarantees your library wants to provide
alright
My implementation of a type_name utility is here if it's of any help https://github.com/jeremy-rifkin/libassert/blob/8941db76468e0c57600494cef67b13c2d4672581/include/assert.hpp#L557
oo
i don't have any substring functions like that yet, do you think i should use signature.rfind('>') - start or signature.size() - start - 7 for the msvc thing?
oh the function is literally defined above
I found the substring helper a nice way to be expressive but you can definitely do it with signature.rfind('>') - start
commencing thievery
so i should prefer that over hardcoding 7 i see
your helper doesnt handle i being npos
does it happen anyway? HM
no
i dont think
i made before, after, and between string functions
There's never just one way to do a problem but that should work
ok is there a better way?
best practices