|
Boost : |
Subject: Re: [boost] Review manager needed for TTI library
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2011-05-10 04:14:25
On Mon, May 9, 2011 at 10:16 PM, Edward Diener <eldiener_at_[hidden]> 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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk