public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/5012: cannot instantiate std::binder1st<std::mem_fun1_t<void, unary_functor<const int&, void\>, const int&> >
@ 2002-01-21 20:57 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-01-21 20:57 UTC (permalink / raw)
  To: a.metselaar, gcc-bugs, gcc-prs, paolo

Synopsis: cannot instantiate std::binder1st<std::mem_fun1_t<void, unary_functor<const int&, void\>, const int&> >

State-Changed-From-To: feedback->closed
State-Changed-By: rodrigc
State-Changed-When: Mon Jan 21 20:57:33 2002
State-Changed-Why:
    No feedback.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5012


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libstdc++/5012: cannot instantiate std::binder1st<std::mem_fun1_t<void, unary_functor<const int&, void\>, const int&> >
@ 2001-12-26  3:57 paolo
  0 siblings, 0 replies; 3+ messages in thread
From: paolo @ 2001-12-26  3:57 UTC (permalink / raw)
  To: a.metselaar, gcc-bugs, gcc-prs, nobody, paolo

Synopsis: cannot instantiate std::binder1st<std::mem_fun1_t<void, unary_functor<const int&, void\>, 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 <functional>
    using namespace std;
    
    template <class Arg, class Res> 
    struct unary_functor : public unary_function<Arg,Res>
    {
      virtual ~unary_functor() {}
      virtual Res operator() (Arg x) =0;
      binder1st<mem_fun1_t<Res, unary_functor<Arg,Res>, Arg> > 
      func()
      { return bind1st(mem_fun(&unary_functor<Arg,Res>::operator()),this); }
    } ;
    
    class F : public unary_functor<int,void>
    {
      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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* libstdc++/5012: cannot instantiate std::binder1st<std::mem_fun1_t<void, unary_functor<const int&, void\>, const int&> >
@ 2001-12-04 11:46 a.metselaar
  0 siblings, 0 replies; 3+ messages in thread
From: a.metselaar @ 2001-12-04 11:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5012
>Category:       libstdc++
>Synopsis:       cannot instantiate std::binder1st<std::mem_fun1_t<void, unary_functor<const int&, void\>, const int&> >
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 04 11:46:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Arnold Metselaar
>Release:        3.0.2 (Debian) (Debian testing/unstable)
>Organization:
>Environment:
System: Linux khumbu 2.2.19 #5 Thu Nov 22 20:52:49 CET 2001 i686 unknown
Architecture: i686
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
cannot instantiate std::binder1st<std::mem_fun1_t<void, unary_functor<const int&, void>, const int&> >; forming reference to reference
transcript:
arnold [~/test]$ g++-3.0 -Wall testbind.cpp
/usr/include/g++-v3/bits/stl_function.h: In instantiation of `std::binder1st<std::mem_fun1_t<void, unary_functor<const int&, void>, const int&> >':
testbind.cpp:22:   instantiated from here
/usr/include/g++-v3/bits/stl_function.h:228: forming reference to reference
type `const int& const'
/usr/include/g++-v3/bits/stl_function.h:234: forming reference to reference
type `const int&'
>How-To-Repeat:
g++-3.0 -Wall testbind.cpp

note: This problem is the same as #5011, but gccbug happily
sent a bugreport without attachment
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="testbind.cpp"; name="testbind.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="testbind.cpp"

dXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2luY2x1ZGUgPGZ1bmN0aW9uYWw+Cgp0ZW1wbGF0ZSA8Y2xh
c3MgQXJnLCBjbGFzcyBSZXM+IApzdHJ1Y3QgdW5hcnlfZnVuY3RvciA6IHB1YmxpYyB1bmFyeV9m
dW5jdGlvbjxBcmcsUmVzPgp7CiAgdmlydHVhbCB+dW5hcnlfZnVuY3RvcigpIHt9CiAgdmlydHVh
bCBSZXMgb3BlcmF0b3IoKSAoQXJnIHgpID0wOwogIGJpbmRlcjFzdDxtZW1fZnVuMV90PFJlcywg
dW5hcnlfZnVuY3RvcjxBcmcsUmVzPiwgQXJnPiA+IAogIGZ1bmMoKQogIHsgcmV0dXJuIGJpbmQx
c3QobWVtX2Z1bigmdW5hcnlfZnVuY3RvcjxBcmcsUmVzPjo6b3BlcmF0b3IoKSksdGhpcyk7IH0K
fSA7CgpjbGFzcyBGIDogcHVibGljIHVuYXJ5X2Z1bmN0b3I8Y29uc3QgaW50ICYsdm9pZD4Kewog
IHZvaWQgb3BlcmF0b3IoKSAoY29uc3QgaW50ICYgaSkgeyByZXR1cm47IH0KfSBmOwoKCmludCBt
YWluKCkKewogIGYuZnVuYygpOwp9Cgo=


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-01-22  4:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-21 20:57 libstdc++/5012: cannot instantiate std::binder1st<std::mem_fun1_t<void, unary_functor<const int&, void\>, const int&> > rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2001-12-26  3:57 paolo
2001-12-04 11:46 a.metselaar

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).