Boost logo

Boost Users :

From: Jerry Jeremiah (jerry_jeremiah_at_[hidden])
Date: 2006-09-26 17:00:33


Jaakko Jarvi <jarvi <at> cs.tamu.edu> writes:

>
> It seems that the compiler cannot select between the "select" functions:
>
> template<class Arg, CALL_TEMPLATE_ARGS>
> inline typename Arg::template sig<tuple<CALL_REFERENCE_TYPES> >::type
> select ( const lambda_functor<Arg>& op, CALL_FORMAL_ARGS ) {
> return op.template call<
> typename Arg::template sig<tuple<CALL_REFERENCE_TYPES> >::type
> >(CALL_ACTUAL_ARGS);
> }
> template<class Arg, CALL_TEMPLATE_ARGS>
> inline typename Arg::template sig<tuple<CALL_REFERENCE_TYPES> >::type
> select ( lambda_functor<Arg>& op, CALL_FORMAL_ARGS) {
> return op.template call<
> typename Arg::template sig<tuple<CALL_REFERENCE_TYPES> >::type
> >(CALL_ACTUAL_ARGS);
> }
>
> As far as I can tell,
> the first one should be a better match for a "const
> lambda_functor<...>" type, as in your example,
> but for some reason the compiler seems to think both matches are equal.
>
> Based on what I see here, I would blaim the compiler.
>
> Jaakko
>

Hi Jaakko,

Thank you. For the help deciphering the error messages.
I gathered that the compiler couldn't choose between the functions,
but was unable to understand why. When you wrote them down in isolation
it was pretty obvious that the compiler should have been able to choose.
I hate compilers. This one doesn't work, the aCC on my HP box doesn't work
and my desktop's Visual C++ doesn't work. I wouldn't want to be a compiler
writer - that's for sure.

Jerry

# On Sep 25, 2006, at 5:29 PM, Jerry Jeremiah wrote:
#
# > Hello,
# >
# > I would appreciate any help with this. I am trying to compile this
# > test program on AIX with xlC (VisualAge C++ Professional / C for AIX
# > Compiler, Version 6):
# >
# > #include <iostream> // cout
# > #include <vector> // vector
# > #include <algorithm> // for_each
# > #include "boost/lambda/lambda.hpp"
# > using namespace boost::lambda;
# > main() {
# > std::vector<int> a;
# > a.push_back(1);
# > std::for_each(a.begin(), a.end(), std::cout << _1 << ' ');
# > }
# >
# >
# > And I get:
# >
# > ...indecipherable error messages...


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net