Subject: Re: [boost] Is there interest in copyable type_info that does not require RTTI (was: Is there interest in typeid(TYPE).name() like function that does not require RTTI)
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2012-05-31 15:18:04
2012/5/31 Daniel Larimer <dlarimer_at_[hidden]>:
> Yes there is interest. I would like to disable RTTI but cannot because of boost::any and boost::function.
Yeep. Thats why I started that.
> This almost gets into some basic level of reflection. The ability to query 'parts' of the name may be useful... such as get_template_info<std::string>().namespace() => "std"
Interesting feature, but I won`t implement it right now.
> Given the basic functionality you describe, it would probably only involve some extra 'one-time init' name parsing if there isn't a simpler method.
For raw_name() it has no extra 'one-time init' name parsing. For
demangled name it require std::string construction. For comparisons it
require std::strcmp on PART of the BOOST_CURRENT_FUNCTION name.
hash_value() is counted on a PART of the BOOST_CURRENT_FUNCTION.
> A key requirement would be that the same strings be generated on all compilers such that types can be compared for RPC purposes.
This looks currently impossible:
MSVC will produce 'class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >'
GCC will produce 'std::basic_string<char>'
> Even without my suggested additions, I think this would be a worthy move.
Thanks. I`ll clean up the code, add documentation and tests and commit
it at this or next week to sandbox or github.
-- Best regards, Antony Polukhin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk