This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "is_member_function_pointer" method with function arguments


Jonathan Wakely schrieb am 11.12.2013 00:44:

> On 10 December 2013 12:28, Stefan wrote:
>>
>> But: The code is not "working" (wonât compile) if the function has one or
>> more arguments like the resize() function (for basic_strings):
>>
>>
>> static_assert(std::is_member_function_pointer<(T::resize)(std::basic_string<char,
>> std::char_traits<char>,
>>                               std::allocator<char>>::size_type)>::value, "T
>>                               has no member method append()");
> 
> I don't really understand what you're trying to do here.
> (T::resize)(std::string::size_type) is not a valid type.
> 

Hi Jonathan,

thanks for your reply. The main intention was to check if a certain function exists for specific class (at compile time). For non overloaded functions - as you mentioned - it is working, like c_str() or data() (basic_string class) but I'm still searching for a code to overloaded functions, like resize().

Thanks again,

Stefan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]