From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14995 invoked by alias); 26 Dec 2001 11:57:20 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 14963 invoked by uid 61); 26 Dec 2001 11:57:19 -0000 Date: Wed, 26 Dec 2001 03:57:00 -0000 Message-ID: <20011226115719.14962.qmail@sources.redhat.com> To: a.metselaar@math.utwente.nl, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, paolo@gcc.gnu.org From: paolo@gcc.gnu.org Reply-To: paolo@gcc.gnu.org, a.metselaar@math.utwente.nl, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, paolo@gcc.gnu.org, gcc-gnats@gcc.gnu.org X-Mailer: gnatsweb 2.9.3 Subject: Re: libstdc++/5012: cannot instantiate std::binder1st, const int&> > X-SW-Source: 2001-12/txt/msg01113.txt.bz2 List-Id: Synopsis: cannot instantiate std::binder1st, const int&> > Responsible-Changed-From-To: unassigned->paolo Responsible-Changed-By: paolo Responsible-Changed-When: Wed Dec 26 03:57:19 2001 Responsible-Changed-Why: Taking care of it State-Changed-From-To: open->feedback State-Changed-By: paolo State-Changed-When: Wed Dec 26 03:57:19 2001 State-Changed-Why: As written, your code leads to a "reference to a reference" problem, which is definitely *not* a library bug (according to the standard, 20.3.6.1, binder1st has typename Operation::result_type operator()(const typename Operation::second_argument_type& x) const;) Perhaps would serve your needs a variant like: #include using namespace std; template struct unary_functor : public unary_function { virtual ~unary_functor() {} virtual Res operator() (Arg x) =0; binder1st, Arg> > func() { return bind1st(mem_fun(&unary_functor::operator()),this); } } ; class F : public unary_functor { void operator() (int i) { return; } } f; int main() { f.func(); } ??? http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5012