|
Boost : |
Subject: Re: [boost] [Review] TTI
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-07-27 10:13:00
On 7/26/2011 5:53 PM, Nathan Ridge wrote:
>
>>> One thing that I think is missing is the option to check for a named
>>> callable within a type. For example, one might want to use enable_if
>>> style concept checking. So long as a type has function 'xxx' that takes
>>> arguments of type x,y,and z, and returns something convertible to type
>>> A, the concept is obeyed. I don't believe this can be done with C++03,
>>> but with C++1X I was able to do something using decltype.
>>
>> By "named callable" do you mean a member function or static member
>> function of the type ? TTI can check for that. Or is there some other
>> criteria for which you are looking ?
>
> I think a (public) member variable with an operator() also qualifies
> as a "named callable". Admittedly, it's not something you see often...
You mean an operator in general which is a member function or static
function of a class ? Or just a function object operator ? I had not
thought about that, but it might be possible to see if that exists also.
I will look into that possibility for TTI.
However Frederick Bron's extension to type traits, which is called type
traits operators, does find out whether a particular operator exists for
a given type. I am not sure offhand whether or not it supports the call
operator '()' for function objects or not.
Eddie
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk