From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18654 invoked by alias); 9 Feb 2009 17:21:49 -0000 Received: (qmail 18242 invoked by alias); 9 Feb 2009 17:21:29 -0000 Date: Mon, 09 Feb 2009 17:21:00 -0000 Message-ID: <20090209172129.18236.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/39136] std::mem_fun_ref fails to accept a member function whose second argument with default value In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fang at csl dot cornell dot edu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-02/txt/msg00798.txt.bz2 ------- Comment #6 from fang at csl dot cornell dot edu 2009-02-09 17:21 ------- Subject: Re: std::mem_fun_ref fails to accept a member function whose second argument with default value > ------- Comment #5 from paolo dot carlini at oracle dot com 2009-02-09 16:47 ------- > Your snippet boils down to this, which is clearly invalid: > > struct vector > { > void resize(long unsigned int, int = 0); > }; > > template > void > mem_fun_ref(_Ret (_Tp::*__f)(_Arg)); > > void > test() { > mem_fun_ref(&vector::resize); > } Fair enough, that's what I wanted to know. I suppose mem_fun_ref(&vector::resize) just *happened* to be accepted in earlier versions of libstdc++, when it was never required to do so. The following declaration was what allowed it to do so. // 4.0.1 // class vector { void resize(size_type __new_size) { resize(__new_size, value_type()); } // }; Was there a compelling reason to remove it in favor of the unified ::resize(size_type, const value_type& t = T)? Anyhow, thanks for the feedback! Fang -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39136