2014-04-30 17:22 GMT+04:00 Karsten Ahnert
Hi,
Here is my review of the Type Index library. I have not studied version 2.1, so everything is entirely based on v3.0
1. What is your evaluation of the design?
Seems reasonable to me. It is an enhancement of std::type_info with additional functionality and methods. I think the most useful function is pretty_name(). There have been some discussion about the namespace, I also do not like boost::typeind. boost::typeindex would be fine for me.
I have one suggestion: Can e method for splitting the name into a part for the namesapce and a part for the type name be provided? Or even a range of (nested) namespace names. I could imagine something like
type_id< A::B::Foo >.type_name() prints "Foo" and type_id< A::B::Foo >.namespace_name() returns a range with ["A","B"]
This could be useful but I'd rather not put it in this library. Such functionality is not widely requested and can be easily implemented manually using Standard library and type_id<T>().pretty_name(). If there'll be a way to add more reflection functionality I'd make a separate library.
2. What is your evaluation of the implementation?
I searched the code to find the place where the name in pretty_name is generated, and I found __cxa_demanlge :). No seriously, I have not looked very detailed into the implementation.
3. What is your evaluation of the documentation?
Documentation is fine. Maybe an example with the output of pretty_name() could be put into the Getting started section, to see immediately the advantage of this library. And an example with namespaces would be great, showing that namespaces are also correctly displayed.
OK, I'll fix that.
4. What is your evaluation of the potential usefulness of the library?
For me it is really useful. I have two use cases where I would immediately use this library, one is showing the name of expections and the other is giving better error messages in a type erased library.
5. Did you try to use the library? With what compiler? Did you have any problems?
Yes, I played around with it for 1-2 hour. Works out of the box, with gcc-4.7 and gcc-4.8. There where no problems, everything works smoothly.
6. How much effort did you put into your evaluation? A glance? A quick reading? In-depth study?
1-2 hour with playing with examples and reading the docs.
7. Are you knowledgeable about the problem domain?
A bit.
And finally, every review should answer this question:
8. Do you think the library should be accepted as a Boost library? Be sure to say this explicitly so that your other comments don't obscure your overall opinion.
Yes, I think it should be accepted.
Thank you for the review! -- Best regards, Antony Polukhin