|
Boost : |
Subject: [boost] [phoenix] msvc 8.0 errors
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2012-01-27 12:43:57
Hello all,
Why doesn't this Phoenix 3.0 code compile? (I'm sure, I'm doing
something wrong... but I can't see what...)
#include <boost/spirit/include/phoenix.hpp>
#define BOOST_TEST_MODULE AddPhoenix
#include <boost/test/unit_test.hpp>
#include <algorithm>
#include <iostream>
BOOST_AUTO_TEST_CASE( add_phoenix )
//[add_phoenix
{
using boost::phoenix::let;
using boost::phoenix::local_names::_f;
using boost::phoenix::cref;
using boost::phoenix::ref;
using boost::phoenix::arg_names::_1;
int sum = 0, factor = 10;
int nums[] = {1, 2, 3};
// Passed to template, `factor` by constant, and defined in expression.
std::for_each(nums, nums + 3, let(_f = cref(factor))[
// Unfortunately, body cannot use C++ statement syntax.
ref(sum) += _f * _1 // Access `sum` by reference.
]);
BOOST_CHECK( sum == 60 );
}
//]
On MSVC 8.0:
...patience...
...patience...
...found 3219 targets...
...updating 114 targets...
compile-c-c++ bin\add_phoenix.test\msvc-8.0\debug\threading-multi\add_phoenix.obj
add_phoenix.cpp
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(54)
: error C2784: 'boost::phoenix::actor<as_composite<boost::phoenix::multiplies_eval,T0,boost::phoenix::actor<BaseT1>>::type>
boost::phoenix::operator *(const T0 &,const
boost::phoenix::actor<BaseT1> &)' : could not deduce template argument
for 'const boost::phoenix::actor<BaseT1> &' from 'boost::mpl::void_'
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(107)
: see declaration of 'boost::phoenix::operator *'
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/mpl/eval_if.hpp(41)
: see reference to class template instantiation
'boost::phoenix::result_of_multiplies<X,Y>' being compiled
with
[
X=const int &,
Y=boost::mpl::void_ &
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(76)
: see reference to class template instantiation
'boost::mpl::eval_if<C,F1,F2>' being compiled
with
[
C=boost::mpl::or_<boost::phoenix::is_actor<const int
&>,boost::phoenix::is_actor<boost::mpl::void_ &>>,
F1=boost::phoenix::re_curry<boost::phoenix::multiplies_eval,const
int &,boost::mpl::void_ &>,
F2=boost::phoenix::result_of_multiplies<const int
&,boost::mpl::void_ &>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/core/detail/composite_eval.hpp(88)
: see reference to class template instantiation
'boost::phoenix::multiplies_eval::result<Env,A0,A1>' being compiled
with
[
Env=boost::phoenix::scoped_environment<boost::phoenix::basic_environment<>,boost::phoenix::basic_environment<>,boost::fusion::vector1<const
int &>,boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>>,
A0=boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,
A1=boost::phoenix::argument<0>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/core/composite.hpp(60)
: see reference to class template instantiation
'boost::phoenix::detail::composite_eval<2>::result<Composite,Env>'
being compiled
with
[
Composite=boost::phoenix::composite<boost::phoenix::multiplies_eval,boost::fusion::vector<boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,boost::phoenix::argument<0>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,
Env=boost::phoenix::scoped_environment<boost::phoenix::basic_environment<>,boost::phoenix::basic_environment<>,boost::fusion::vector1<const
int &>,boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(68)
: see reference to class template instantiation
'boost::phoenix::composite<EvalPolicy,EvalTuple>::result<Env>' being
compiled
with
[
EvalPolicy=boost::phoenix::multiplies_eval,
EvalTuple=boost::fusion::vector<boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,boost::phoenix::argument<0>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>,
Env=boost::phoenix::scoped_environment<boost::phoenix::basic_environment<>,boost::phoenix::basic_environment<>,boost::fusion::vector1<const
int &>,boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/core/detail/composite_eval.hpp(88)
: see reference to class template instantiation
'boost::phoenix::plus_assign_eval::result<Env,A0,A1>' being compiled
with
[
Env=boost::phoenix::scoped_environment<boost::phoenix::basic_environment<>,boost::phoenix::basic_environment<>,boost::fusion::vector1<const
int &>,boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>>,
A0=boost::phoenix::reference<int>,
A1=boost::phoenix::composite<boost::phoenix::multiplies_eval,boost::fusion::vector<boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,boost::phoenix::argument<0>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/core/composite.hpp(60)
: see reference to class template instantiation
'boost::phoenix::detail::composite_eval<2>::result<Composite,Env>'
being compiled
with
[
Composite=boost::phoenix::composite<boost::phoenix::plus_assign_eval,boost::fusion::vector<boost::phoenix::reference<int>,boost::phoenix::composite<boost::phoenix::multiplies_eval,boost::fusion::vector<boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,boost::phoenix::argument<0>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,
Env=boost::phoenix::scoped_environment<boost::phoenix::basic_environment<>,boost::phoenix::basic_environment<>,boost::fusion::vector1<const
int &>,boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/scope/let.hpp(48)
: see reference to class template instantiation
'boost::phoenix::composite<EvalPolicy,EvalTuple>::result<Env>' being
compiled
with
[
EvalPolicy=boost::phoenix::plus_assign_eval,
EvalTuple=boost::fusion::vector<boost::phoenix::reference<int>,boost::phoenix::composite<boost::phoenix::multiplies_eval,boost::fusion::vector<boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,boost::phoenix::argument<0>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>,
Env=boost::phoenix::scoped_environment<boost::phoenix::basic_environment<>,boost::phoenix::basic_environment<>,boost::fusion::vector1<const
int &>,boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/core/actor.hpp(56)
: see reference to class template instantiation
'boost::phoenix::let_actor<Base,Vars,Map>::result<Env>' being compiled
with
[
Base=boost::phoenix::composite<boost::phoenix::plus_assign_eval,boost::fusion::vector<boost::phoenix::reference<int>,boost::phoenix::composite<boost::phoenix::multiplies_eval,boost::fusion::vector<boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,boost::phoenix::argument<0>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,
Vars=boost::fusion::vector<boost::phoenix::reference<const
int>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>,
Map=boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>,
Env=boost::phoenix::basic_environment<>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/mpl/eval_if.hpp(41)
: see reference to class template instantiation
'boost::phoenix::eval_result<Eval,Env>' being compiled
with
[
Eval=boost::phoenix::let_actor<boost::phoenix::composite<boost::phoenix::plus_assign_eval,boost::fusion::vector<boost::phoenix::reference<int>,boost::phoenix::composite<boost::phoenix::multiplies_eval,boost::fusion::vector<boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,boost::phoenix::argument<0>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,boost::fusion::vector<boost::phoenix::reference<const
int>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>,boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>>,
Env=boost::phoenix::basic_environment<>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/core/actor.hpp(91)
: see reference to class template instantiation
'boost::mpl::eval_if<C,F1,F2>' being compiled
with
[
C=boost::mpl::bool_<false>,
F1=boost::mpl::identity<boost::phoenix::detail::error_expecting_arguments>,
F2=boost::phoenix::eval_result<boost::phoenix::let_actor<boost::phoenix::composite<boost::phoenix::plus_assign_eval,boost::fusion::vector<boost::phoenix::reference<int>,boost::phoenix::composite<boost::phoenix::multiplies_eval,boost::fusion::vector<boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,boost::phoenix::argument<0>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,boost::fusion::vector<boost::phoenix::reference<const
int>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>,boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>>,boost::phoenix::basic_environment<>>
]
add_phoenix.cpp(29) : see reference to class template
instantiation 'boost::phoenix::actor<Eval>' being compiled
with
[
Eval=boost::phoenix::let_actor<boost::phoenix::composite<boost::phoenix::plus_assign_eval,boost::fusion::vector<boost::phoenix::reference<int>,boost::phoenix::composite<boost::phoenix::multiplies_eval,boost::fusion::vector<boost::phoenix::local_variable<boost::phoenix::local_names::_f_key>,boost::phoenix::argument<0>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>>,boost::fusion::vector<boost::phoenix::reference<const
int>,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_,boost::fusion::void_>,boost::phoenix::detail::map_local_index_to_tuple<boost::phoenix::local_names::_f_key,boost::phoenix::detail::unused<1>,boost::phoenix::detail::unused<2>,boost::phoenix::detail::unused<3>,boost::phoenix::detail::unused<4>,boost::phoenix::detail::unused<5>,boost::phoenix::detail::unused<6>,boost::phoenix::detail::unused<7>,boost::phoenix::detail::unused<8>,boost::phoenix::detail::unused<9>>>
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(54)
: error C2784: 'boost::phoenix::actor<as_composite<boost::phoenix::multiplies_eval,boost::phoenix::actor<Eval>,T1>::type>
boost::phoenix::operator *(const boost::phoenix::actor<Eval> &,const
T1 &)' : could not deduce template argument for 'const
boost::phoenix::actor<Eval> &' from 'const int'
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(107)
: see declaration of 'boost::phoenix::operator *'
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(54)
: error C2784: 'boost::phoenix::actor<as_composite<boost::phoenix::multiplies_eval,boost::phoenix::actor<Eval>,boost::phoenix::actor<BaseT1>>::type>
boost::phoenix::operator *(const boost::phoenix::actor<Eval> &,const
boost::phoenix::actor<BaseT1> &)' : could not deduce template argument
for 'const boost::phoenix::actor<Eval> &' from 'const int'
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(107)
: see declaration of 'boost::phoenix::operator *'
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(54)
: error C2677: binary '*' : no global operator found which takes type
'boost::mpl::void_' (or there is no acceptable conversion)
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(54)
: error C2866: 'boost::phoenix::result_of_multiplies<X,Y>::size' : a
const static data member of a managed type must be initialized at the
point of declaration
with
[
X=const int &,
Y=boost::mpl::void_ &
]
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(54)
: error C2057: expected constant expression
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/spirit/home/phoenix/operator/arithmetic.hpp(54)
: error C2975: 'N' : invalid template argument for 'boost::mpl::at_c',
expected compile-time constant expression
C:\Users\lorcam\Desktop\code\boost\trunk.windows\boost/mpl/at.hpp(41)
: see declaration of 'N'
call "C:\Program Files (x86)\Microsoft Visual Studio
8\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo
@"bin\add_phoenix.test\msvc-8.0\debug\threading-multi\add_phoenix.obj.rsp"
...failed compile-c-c++
bin\add_phoenix.test\msvc-8.0\debug\threading-multi\add_phoenix.obj...
...failed updating 1 target...
Thanks a lot!
--Lorenzo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk