Subject: [boost] [tti] review
From: Gordon Woodhull (gordon_at_[hidden])
Date: 2011-07-17 13:53:32
Hi Eddie, Joel, all,
I apologize that this is a very short review.
I believe the library should be accepted.
The only interesting thing I have to add to the discussion is that a comparison with concepts should be made at least here, and perhaps in the documentation. This library provides functionality that will also be achievable using concepts, e.g. with Matt Calabrese's Generic library.
I surmise that TTI presents a slightly messier low-level way of figuring out what a type is capable of than concepts and concept-based overloading. So I figure that as usual in such situations, TTI would be more powerful and more concise for checking individual things, and more confusing and verbose for checking the entire interface of a type.
I think it's good to have both a low-level and an abstract way of doing things. TTI and Generic probably share some techniques and could learn from each other.
A few superficial comments below.
I agree with Jeff's suggestion that the matching metafunction should take a metafunction that defaults to is_same rather than always testing for type equality (and now I see why he was also suggesting that in the Type Traits Extension review :).
Personally I would use the placeholder expressions and not the metafunction classes, because I find it clearer, unless I really thought it would help with performance.
I think I would prefer a smaller set of more clever macros as Lorenzo was suggesting, but this wouldn't affect my decision to use the library unless there were two that did the same thing.
I was alarmed (yes, alarmed! frightened!) by
template <class)(int> class InnerTemplate
but IIUC this would only happen without variadic macros, so I don't care. Otherwise it would probably crash my emacs.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk