public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: eekaikko@mail.student.oulu.fi
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/2772: bind2nd(mem_fun1_ref) does not work
Date: Tue, 08 May 2001 06:46:00 -0000	[thread overview]
Message-ID: <20010508134044.15018.qmail@sourceware.cygnus.com> (raw)

>Number:         2772
>Category:       libstdc++
>Synopsis:       bind2nd(mem_fun1_ref) does not work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue May 08 06:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     gcc weekly snapshot
>Release:        gcc version 3.0 20010430 (prerelease)
>Organization:
>Environment:
Debian gnu/linux potato
>Description:
The following code (the whole code is in the attatchment):



    list<myclass> mylist;

    for_each(mylist.begin(), mylist.end(),

             bind2nd(mem_fun1_ref(&myclass::f), 2));



where f = "int f(int i)"

produces this message:



/usr/local/include/g++-v3/bits/stl_function.h: In member function `typename

   _Operation::result_type std::binder2nd<_Operation>::operator()(typename

   _Operation::first_argument_type&) const [with _Operation =

   std::mem_fun1_ref_t<int, myclass, int>]':

/usr/local/include/g++-v3/bits/stl_algo.h:90:   instantiated from `_Function std::for_each(_InputIter, _InputIter, _Function) [with _InputIter = std::_List_iterator<myclass, myclass&, myclass*>, _Function = std::binder2nd<std::mem_fun1_ref_t<int, myclass, int> >]'

testaus.cpp:23:   instantiated from here

/usr/local/include/g++-v3/bits/stl_function.h:224: no match for call to `(const

   std::mem_fun1_ref_t<int, myclass, int>) (const myclass&, const int&)'

/usr/local/include/g++-v3/bits/stl_function.h:578: candidates are: _Ret

   std::mem_fun1_ref_t<_Ret, _Tp, _Arg>::operator()(_Tp&, _Arg) const [with

   _Ret = int, _Tp = myclass, _Arg = int]





(See also bug #470, it seems to relate to this.)



I have tried also an older gcc-snapshot and 2.95.2 (with its own library). They produce the same error.
>How-To-Repeat:
By trying to compile (g++ testaus.cpp).
>Fix:
?
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2001-05-08  6:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-08  6:46 eekaikko [this message]
2001-06-11 12:11 bkoz
2001-06-26 17:16 bkoz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010508134044.15018.qmail@sourceware.cygnus.com \
    --to=eekaikko@mail.student.oulu.fi \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).