This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: "is_member_function_pointer" method with function arguments
- From: "Stefan" <stefan at schweter dot it>
- To: jwakely dot gcc at gmail dot com
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Tue, 17 Dec 2013 21:57:47 +0100 (CET)
- Subject: Re: "is_member_function_pointer" method with function arguments
- Authentication-results: sourceware.org; auth=none
- References: <20131210122828 dot B50816E4356C at dd32626 dot kasserver dot com><CAH6eHdTJmXzkcpZJPVxcnMFdm2iVNgJSETncF1kyU4SH83M1sQ at mail dot gmail dot com>
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