Boost logo

Boost Users :

From: Levent Yilmaz (sly5+gmane_at_[hidden])
Date: 2006-09-30 19:13:18


Hi All,

Please take a look these two similar set of statements. One uses vector,
the other boost::array :

/**/

using std::vector;
using boost::array;
using std::for_each;
using boost::lambda::_1;

// This one compiles:
typedef vector<int> Vector;
Vector v(2);
vector<Vector> vv(5,v);
for_each( vv.begin(), vv.end(), (_1[0]=10, _1[1]=9) );

// This one doesn't:
typedef array<int,2> Array;
vector<Array> va(5);
for_each( va.begin(), va.end(), (_1[0]=10, _1[1]=9) );

/**/

With MSVC 7.1, I get:
=====
d:\boost\include\boost-1_33_1\boost\lambda\detail\operator_lambda_func_base.hpp(237):
  error C2679: binary '=' : no operator found which takes a right-hand
operand of type 'const boost::tuples::cons<HT,TT>::stored_head_type' (or
there is no acceptable conversion)
         with
         [
             HT=const boost::lambda::detail::parameter_traits_<const
int,const boost::lambda::detail::IF<false,const int &,const
int>::RET>::type,
 
TT=boost::tuples::detail::map_tuple_to_cons<boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type
         ]
======================================================

With gcc 3.4.4, I get a moderately sized novel, whose last line reads:
=====
/usr/local/include/boost/lambda/detail/operator_lambda_func_base.hpp:136:
error: conversion from `int' to non-scalar type
`boost::lambda::detail::unspecified' requested
=======================================================

This is boost version 1.33.1.
What could be wrong?

thx


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