[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Nested std::tr1::bind problem
From: |
Rodolfo Lima |
Subject: |
Nested std::tr1::bind problem |
Date: |
Mon, 10 Mar 2008 09:06:53 -0300 |
User-agent: |
Thunderbird 2.0.0.12 (X11/20080310) |
Hi, I'm playing a little bit with std::tr1::bind and found that the
following code doesn't compile:
bind(std::multiplies<int>(), _1, bind(std::minus<int>(), 6, _2))(1,2);
but the following does:
int one=1, two=2;
bind(std::multiplies<int>(), _1, bind(std::minus<int>(), 6, _2))(one,two);
The error in the first code is:
error: no match for call to '(std::_Bind<std::multiplies<int>
()(std::_Placeholder<1>, std::_Bind<std::minus<int> ()(int,
std::_Placeholder<2>)>)>) (int, int)'
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/tr1_impl/functional:1189:
note: candidates are: typename std::result_of<_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& ...) [with _Args = int, int, _Functor =
std::multiplies<int>, _Bound_args = std::_Placeholder<1>,
std::_Bind<std::minus<int> ()(int, std::_Placeholder<2>)>]
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/tr1_impl/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, int, _Functor =
std::multiplies<int>, _Bound_args = std::_Placeholder<1>,
std::_Bind<std::minus<int> ()(int, std::_Placeholder<2>)>]
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/tr1_impl/functional:1212:
note: typename std::result_of<volatile _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& ...)
volatile [with _Args = int, int, _Functor = std::multiplies<int>,
_Bound_args = std::_Placeholder<1>, std::_Bind<std::minus<int> ()(int,
std::_Placeholder<2>)>]
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/tr1_impl/functional:1225:
note: typename std::result_of<const volatile _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
volatile [with _Args = int, int, _Functor = std::multiplies<int>,
_Bound_args = std::_Placeholder<1>, std::_Bind<std::minus<int> ()(int,
std::_Placeholder<2>)>]
make[2]: ** [CMakeFiles/test.dir/main.cpp.o] Erro 1
make[1]: ** [CMakeFiles/test.dir/all] Erro 2
make: ** [all] Erro 2
The question... why is it so??
- Nested std::tr1::bind problem,
Rodolfo Lima <=