Hi,
Thanks for solving my previous find() problem.
I found another problem of range_ex. The following code still works well with the old version of range_ex (Dec 2008), and cause a compile error with the newest version.
code:
#include
#include
#include
#include
#include
#include <iostream>
#include <vector>
bool is_even(int x) { return x % 2 == 0; }
int main()
{
using namespace boost::assign;
using namespace boost::adaptors;
using namespace boost::lambda;
std::vector<int> input;
input += 1,2,3,4,5,6,7,8,9;
boost::copy( input | filtered(bind(is_even, _1)),
std::ostream_iterator<int>(std::cout, ",") );
return 0;
}
compiler: msvc2008
error messages:
d:\software\boost_1_37_0\boost\lambda\detail\lambda_traits.hpp(389) : warning C4180: qualifier applied to function type has no meaning; ignored
d:\software\boost_1_37_0\boost\lambda\detail\lambda_traits.hpp(458) : see reference to class template instantiation 'boost::lambda::detail::bind_traits<T>' being compiled
with
[
T=bool (int)
]
e:\zxg\boost\range_ex\range.cpp(20) : see reference to class template instantiation 'boost::lambda::detail::bind_tuple_mapper' being compiled
with
[
T0=bool (int),
T1=boost::lambda::placeholder1_type,
T2=boost::tuples::null_type,
T3=boost::tuples::null_type,
T4=boost::tuples::null_type,
T5=boost::tuples::null_type,
T6=boost::tuples::null_type,
T7=boost::tuples::null_type,
T8=boost::tuples::null_type,
T9=boost::tuples::null_type
]
d:\software\boost_1_37_0\boost\tuple\detail\tuple_basic.hpp(383) : error C3853: '=': re-initializing a reference or assignment through a reference-to-function is illegal
d:\software\boost_1_37_0\boost\tuple\detail\tuple_basic.hpp(382) : while compiling class template member function 'boost::tuples::cons &boost::tuples::cons::operator =(const boost::tuples::cons &)'
with
[
HT=bool (__cdecl &)(int),
TT=boost::tuples::cons>,boost::tuples::detail::map_tuple_to_consboost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,b...::type>
]
d:\software\boost_1_37_0\boost\tuple\detail\tuple_basic.hpp(526) : see reference to class template instantiation 'boost::tuples::cons' being compiled
with
[
HT=bool (__cdecl &)(int),
TT=boost::tuples::cons>,boost::tuples::detail::map_tuple_to_consboost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,b...::type>
]
d:\software\boost_1_37_0\boost\lambda\detail\lambda_functor_base.hpp(398) : see reference to class template instantiation 'boost::tuples::tuple' being compiled
with
[
T0=bool (__cdecl &)(int),
T1=const boost::lambda::lambda_functor>,
T2=boost::lambda::detail::bind_traitsboost::tuples::null_type::type,
T3=boost::lambda::detail::bind_traitsboost::tuples::null_type::type,
T4=boost::lambda::detail::bind_traitsboost::tuples::null_type::type,
T5=boost::lambda::detail::bind_traitsboost::tuples::null_type::type,
T6=boost::lambda::detail::bind_traitsboost::tuples::null_type::type,
T7=boost::lambda::detail::bind_traitsboost::tuples::null_type::type,
T8=boost::lambda::detail::bind_traitsboost::tuples::null_type::type,
T9=boost::lambda::detail::bind_traitsboost::tuples::null_type::type
]
d:\software\boost_1_37_0\boost\lambda\detail\lambda_functors.hpp(113) : see reference to class template instantiation 'boost::lambda::lambda_functor_base' being compiled
with
[
Act=boost::lambda::action<2,boost::lambda::function_action<2,bool>>,
Args=boost::tuples::tuple>,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traits::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type>
]
e:\zxg\boost\range_ex\range.cpp(20) : see reference to class template instantiation 'boost::lambda::lambda_functor<T>' being compiled
with
[
T=boost::lambda::lambda_functor_base>,boost::tuples::tuple>,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detai
l::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type,boost::lambda::detail::bind_traitsboost::tuples::null_type::type>>
]
Thanks,
Roger Zhou