"is_member_function_pointer" method with function arguments
Stefan
stefan@schweter.it
Tue Dec 17 20:57:00 GMT 2013
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
More information about the Libstdc++
mailing list