This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/35569] New: std::[tr1::]bind result functor doesn't accept rvalues


The following code doesn't compile with gcc-4.3.0 on c++0x mode:

using std;
using std::placeholders;
bind(multiplies<int>(),4,_1)(5);

g++ outputs:

teste.cpp:2: error: no match for call to ?(std::_Bind<std::multiplies<int>
()(st
d::_Placeholder<1>, int)>) (int)?
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/tr1_imp
l/functional:1189: note: candidates are: typename std::result_of<_Functor
()(typ
ename std::result_of<std::_Mu<_Bound_args, std::is_bind_expression::value,
(std:
:is_placeholder::value > 0)> ()(_Bound_args, std::tuple<_UElements ...>)>::type 
...)>::type std::_Bind<_Functor ()(_Bound_args ...)>::operator()(_Args& ...)
[wi
th _Args = int, _Functor = std::multiplies<int>, _Bound_args =
std::_Placeholder
<1>, int]
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/tr1_imp
l/functional:1200: note:                 typename std::result_of<const _Functor 
()(typename std::result_of<std::_Mu<_Bound_args,
std::is_bind_expression::value,
 (std::is_placeholder::value > 0)> ()(_Bound_args, std::tuple<_UElements
...>)>:
:type ...)>::type std::_Bind<_Functor ()(_Bound_args ...)>::operator()(_Args&
..
.) const [with _Args = int, _Functor = std::multiplies<int>, _Bound_args =
std::
_Placeholder<1>, int]
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/tr1_imp
l/functional:1212: note:                 typename std::result_of<volatile
_Funct
or ()(typename std::result_of<std::_Mu<_Bound_args,
std::is_bind_expression::val
ue, (std::is_placeholder::value > 0)> ()(_Bound_args, std::tuple<_UElements
...>
)>::type ...)>::type std::_Bind<_Functor ()(_Bound_args
...)>::operator()(_Args&
 ...) volatile [with _Args = int, _Functor = std::multiplies<int>, _Bound_args
=
 std::_Placeholder<1>, int]
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/tr1_imp
l/functional:1225: note:                 typename std::result_of<const volatile 
_Functor ()(typename std::result_of<std::_Mu<_Bound_args,
std::is_bind_expressio
n::value, (std::is_placeholder::value > 0)> ()(_Bound_args,
std::tuple<_UElement
s ...>)>::type ...)>::type std::_Bind<_Functor ()(_Bound_args
...)>::operator()(
_Args& ...) const volatile [with _Args = int, _Functor = std::multiplies<int>,
_
Bound_args = std::_Placeholder<1>, int]

It seems that std::_Bind operator() doesn't accept rvalues. Maybe the arguments
should be passed by rvalue-references and std::forward'ed to the underlying
function (or functor).


-- 
           Summary: std::[tr1::]bind result functor doesn't accept rvalues
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rodolfo at rodsoft dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35569


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]