Hi,
First time poster. I found Boost over the weekend and have to say it's
a great library! It's enabled me to do things in C++ I didn't think
were possible before.
I'm posting because I'm having a problem with boost::fusion::invoke.
I'm using it to call a function with a list of predefined parameters.
I found that if I have 6 or fewer parameters, everything compiles
fine. If I have 7 or more parameters, it doesn't compile. I verified
that it's not the parameters by removing the first 4 and leaving the
last 5 (which was OK).
Here's the code that I think is relevant:
boost::fusion::invoke(func,args);
Args is an iterator
typename boost::mpl::begin<
boost::function_types::parameter_types<Function> >::type
func is a function pointer passed from C++
This is on Visual Studio 2005 using boost 1.35.
I need at least 9 parameters.
Thanks in advance!
For reference, the output from the compiler is pasted below
----------------------
1>c:\boost_1_35_0\boost\fusion\functional\invocation\invoke.hpp(102) :
error C2504:
'boost::fusion::detail::invoke_impl'
: base class undefined
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> Sequence=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<NormalizedVector>>,const
boost::fusion::single_view>,
1> N=9,
1> CBI=false,
1> RandomAccess=false
1> ]
1>
c:\boost_1_35_0\boost\fusion\functional\invocation\invoke.hpp(110) :
see reference to class template instantiation
'boost::fusion::detail::invoke_nonmember_builtin'
being compiled
1> with
1> [
1> F=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> Sequence=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<NormalizedVector>>,const
boost::fusion::single_view>,
1> N=9,
1> RandomAccess=false
1> ]
1>
c:\boost_1_35_0\boost\fusion\functional\invocation\invoke.hpp(159) :
see reference to class template instantiation
'boost::fusion::detail::invoke_impl' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> Sequence=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<NormalizedVector>>,const
boost::fusion::single_view>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(261) : see
reference to class template instantiation
'boost::fusion::result_of::invoke' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> Sequence=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<NormalizedVector>>,const
boost::fusion::single_view>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(247) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker::apply>(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> From=next_iter_type,
1> To=boost::mpl::v_iter,9>,
1> Sequence1=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<NormalizedVector>>,
1> Sequence2=const boost::fusion::single_view,
1> Args=boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<NormalizedVector>>,const
boost::fusion::single_view>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(247) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker::apply>(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> From=next_iter_type,
1> To=boost::mpl::v_iter,9>,
1> Sequence1=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>,
1> Sequence2=const
boost::fusion::single_view<NormalizedVector>,
1> Args=boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<NormalizedVector>>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(247) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker::apply>(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> From=next_iter_type,
1> To=boost::mpl::v_iter,9>,
1> Sequence1=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const boost::fusion::single_view<D>>,
1> Sequence2=const
boost::fusion::single_view,
1> Args=boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(247) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker::apply>(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> From=next_iter_type,
1> To=boost::mpl::v_iter,9>,
1> Sequence1=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,
1> Sequence2=const boost::fusion::single_view<D>,
1> Args=boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const boost::fusion::single_view<D>>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(247) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker::apply>(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> From=next_iter_type,
1> To=boost::mpl::v_iter,9>,
1> Sequence1=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,
1> Sequence2=const boost::fusion::single_view,
1> Args=boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(247) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker::apply>(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> From=next_iter_type,
1> To=boost::mpl::v_iter,9>,
1> Sequence1=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,
1> Sequence2=const boost::fusion::single_view<C>,
1> Args=boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(247) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker::apply>(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> From=next_iter_type,
1> To=boost::mpl::v_iter,9>,
1> Sequence1=const boost::fusion::joint_view>,const boost::fusion::single_view<A>>,
1> Sequence2=const boost::fusion::single_view,
1> Args=boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(247) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker::apply>(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> From=next_iter_type,
1> To=boost::mpl::v_iter,9>,
1> Sequence1=const boost::fusion::joint_view>,
1> Sequence2=const boost::fusion::single_view<A>,
1> Args=boost::fusion::joint_view>,const boost::fusion::single_view<A>>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(247) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker::apply>(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> From=next_iter_type,
1> To=boost::mpl::v_iter,9>,
1> Sequence1=const boost::fusion::nil,
1> Sequence2=const boost::fusion::single_view,
1> Args=boost::fusion::joint_view>
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(336) : see
reference to function template instantiation
'RakNet::_RPC3::InvokeResultCodes
RakNet::_RPC3::BoostRPCInvoker<Function>::apply(Function,RakNet::_RPC3::InvokeArgs,const
Args &)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> Args=boost::fusion::nil
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(335) : while
compiling class template member function
'RakNet::_RPC3::FunctionPointer
RakNet::_RPC3::GetBoundPointer_C<Function>::GetBoundPointer(Function)'
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *)
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3_boost.h(355) : see
reference to class template instantiation
'RakNet::_RPC3::GetBoundPointer_C<Function>' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *)
1> ]
1> c:\raknet\dependentextensions\rpc3\rpc3.h(100) : see
reference to function template instantiation
'RakNet::_RPC3::FunctionPointer
RakNet::_RPC3::GetBoundPointer(Function)'
being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *)
1> ]
1> c:\raknet\samples\rpc3\rpc3sample.cpp(127) : see reference
to function template instantiation 'bool
RakNet::RPC3::RegisterFunction(const char
*,Function)' being compiled
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *)
1> ]
1>c:\boost_1_35_0\boost\fusion\functional\invocation\invoke.hpp(159) :
error C2039: 'result_type' : is not a member of
'boost::fusion::detail::invoke_impl'
1> with
1> [
1> Function=void (__cdecl *)(A *,A &,C *,C &,D *,D
&,NormalizedVector *,NormalizedVector &,RakNet::RPC3 *),
1> Sequence=const boost::fusion::joint_view>,const
boost::fusion::single_view<A>>,const boost::fusion::single_view>,const boost::fusion::single_view<C>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<D>>,const
boost::fusion::single_view>,const
boost::fusion::single_view<NormalizedVector>>,const
boost::fusion::single_view>
1> ]
1>c:\boost_1_35_0\boost\fusion\functional\invocation\invoke.hpp(159) :
error C2146: syntax error : missing ';' before identifier 'type'
1>c:\boost_1_35_0\boost\fusion\functional\invocation\invoke.hpp(159) :
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
1>c:\boost_1_35_0\boost\fusion\functional\invocation\invoke.hpp(159) :
error C2208: 'boost::type' : no members defined using this type
1>c:\boost_1_35_0\boost\fusion\functional\invocation\invoke.hpp(159) :
fatal error C1903: unable to recover from previous error(s); stopping
compilation