Boost logo

Boost :

Subject: Re: [boost] [Review] Type Traits Introspection library by Edward Diener starts tomorrow Friday 1
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-07-05 13:30:26

On 7/5/2011 12:17 PM, Joel falcou wrote:
> On 05/07/11 10:35, Edward Diener wrote:
>>> 2) Further to the above, I wonder if it's worthwhile providing a set of
>>> "standard" introspection classes for the common cases, a straw man list
>>> would be something like:
>>> Types: type, value_type, size_type, difference_type, iterator,
>>> const_iterator, pointer, const_pointer, reference, const_reference.
>>> Static Values: value
>>> Functions: begin(), end(), swap(self_type)
>> That can be easily done once it is determined what to cover.
> metafunctions for preexisting concepts could be nice. Bonsu point if
> they live in a tti/std/???.hpp set of files.
> Basically w/e testing for Container, Range and other common concepts
> should be enough.
>>> I'm also thinking that what folks really want to know is: "Is there a
>>> function named X, that can be called with arguments of types A, B and
>>> C". It would be interesting to see how far along this road we could
>>> actually get?
>> I think Eric Niebler is the expert in this area regarding non-nested
>> functions. But if he and others with more knowledge of determining this
>> for free functions would be willing to help me I can certainly look at
>> it in the future. I just do not think it belongs in this particular
>> library as I conceive of it presently.
> I think i has one in my previous attempt at this kind of library
> but it didnt make its way to my github. Th trick I used was to define
> a function with the same name in the global namespace which prototype
> being:
> non_found_type Name( ... ); // Actual ellipsis
> As f(...) is the last resort in there of overload, testing calling Name(
> some args ) and checking the return type was not not_found_type, you
> know if Ret Name(Tn....) exists as a free function.

I did realize this but as I remember there were some other issues of
function detection which Eric Niebler had solved.

Boost list run by bdawes at, gregod at, cpdaniel at, john at