Boost logo

Boost :

Subject: Re: [boost] [type_traits] has_member_function_callable_with
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-09-17 19:35:04


El 16/09/2011 1:32, Daniel James escribió:
> 2011/9/15 Ion Gaztañaga<igaztanaga_at_[hidden]>:
>> Hi to all,
>>
>> Trying to port C++11 code (allocator_traits) to C++03 (without decltype
>> support), I needed to check at compile time if a member function can be
>> called with some given parameters.
>
> Take a look at:
>
> http://svn.boost.org/svn/boost/trunk/boost/unordered/detail/allocator_helpers.hpp
>
> It contains an incomplete implementation of allocator_traits. I just
> used sizeof instead of decltype for compilers which support SFINAE
> expressions - gcc 4.4+, clang, and visual studio 2008+ (sort of). Look
> for the line:

Thanks for the info, I didn't know about the existence of SFINAE
expressions with sizeof. One of the shortcomings of my proposal is
supporting 0 argument functions, I haven't found yet a way to reliably
detect them.

Best,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk