
On 5/10/2011 4:14 AM, Thomas Heller wrote:
On Mon, May 9, 2011 at 10:16 PM, Edward Diener<eldiener@tropicsoft.com> wrote:
On 5/9/2011 2:59 PM, Thomas Heller wrote:
On Monday, May 09, 2011 08:39:33 PM Edward Diener wrote:
I am looking for a review manager for my TTI library in the review queue.
The TTI library, which is an abbreviation for the 'Type Traits Introspection' library, allows a programmer to introspect at compile time the inner elements of a C++ type. The introspection process depends on specifying the name of the inner element by different macros for different types of elements, and then using a generated metafunction to determine whether that element exists within the enclosing type. The inner elements which can be introspected are type, class template, member data, member function, static member data, and static member function.
Short query about a specific feature I am interested in. Will your library enable the following usecase:
struct foo { template<typename Sig> struct result;
template<typename This, typename A0, typename A1> struct result<This(A0, A1)> { typedef A0; }; };
struct bar { template<typename A0, typename A1> struct result<A0, A1> { typedef A0; }; };
has_old_result<foo, A1, A2>::type // evaluates to false has_old_result<bar, A1, A2>::type // evaluates to true
also supporting "variadic" result_of protocol detection. I failed to come up with a generic solution to that particular problem. Would be awesome if you solved it :)
I do not understand what you are doing above. Maybe if you explained what you are trying to do I can answer.
I just want to check whether a functor supports the Phoenix V2 result protocol or the boost::result_of protocol. "foo" is implementing boost::result_of and "bar" is implementing the Phoenix V2 protocol.
The TTI library can introspect a type to find out what constructs are nested within that type at compile-time, given the name of the construct at a minimum. That is the full extend of what the library does. The only type of inner construct it can not introspect is a function template, but I explain why that can't be done in the Help.
Yes, this is exactly what i want to do here, check if a nested template fullfills certain concepts (not really if its there or not), aka introspecting the (possible) specializations of a nested result type.
The TTI library can check if a nested class template has a given signature, but not if it also has some nested specialization. I think you also want the ability to check if a class template itself has some nested constructs where the TTI library only checks the nested constructs of a type.