|
Boost : |
From: Rani Sharoni (rani_sharoni_at_[hidden])
Date: 2003-02-18 14:11:14
Rani Sharoni wrote:
> Peter Dimov wrote:
>> Rani Sharoni wrote:
>>>
>>> You can probably use a similar approach to implement yet another
>>> is_class (not void, reference and doesn't have an implicit standard
>>> conversion to bool).
>>
>> I wonder whether "int () const" has an implicit standard conversion
>> to bool. ;-)
> Good catch.
>
> According to 8.3.5/7 - A typedef of a function type whose declarator
> includes a cv-qualifier-seq shall be used only to declare the
> function type for a nonstatic member function, to declare the
> function type to which a pointer to member refers, or to declare the
> top level function type of another function typedef declaration.
> This means that you can't take a reference or pointer to such types
> and therefore such types will fail all the is_function implemetations
> I know about (and few other traits like is_convertible).
I forgot that the implementation that uses SFINAE works (creating array of
function type fail the deduction).
> typedef int ftype() const;
>
> template<typename T>
> char *f(T *);
>
> template<typename T>
> long *f(...);
>
> long *p = f<ftype>(0); // Failed to compile using EDG 3.0.1 and GCC3.2
>
> I think that this case should fall under SFINAE and it might worth a
> DR.
>
> Rani
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk