2016-03-25 2:03 GMT+03:00 Klemens Morgenstern
I found a way to get a type_name type at compile type, i.e. a template which has a sequence of chars representing the type. This could be added to boost.type_index and would allow constexpr sorting of types by names etc. E.g. making boost::variant
and boost::variant the same, by ordering the arguments alphabetically. Has lot of compiler overhead though.
I've tried to use __PRETTY_FUNCTION__ directly a year or two ago. Some
compilers allowed that, some not.
Could you try to compile that code on Clang? If that works, try to mark
detail::ctti<T>::n() with constexpr and use in your code:
template
get, though I have to admit: I don't really get how this approach works, so I don't know.
That won't help. I need a way to make conversion of T type to some non-templated class and back: T -> int -> T TypeIndex allows only the first part of that: T -> type_index, but does not allow type_index -> T -- Best regards, Antony Polukhin