|
Boost : |
From: Christian Holmquist (c.holmquist_at_[hidden])
Date: 2007-07-10 11:41:52
There seems to be some problem with fusion::unfused_typed<> and empty
sequences, at least the way I'm trying to use it.
The example below doesn't compile with boost::fusion::vector<> as the
Sequence parameter to unfused_typed<>.
Any clues, someone?
template<class Sequence>
struct foo
{
template<class Sig> struct result;
template<>
struct result<foo(Sequence)>
{
typedef void type;
};
void operator()(Sequence const& seq) const
{
}
};
void bar()
{
{
typedef boost::fusion::vector<int> vec;
boost::fusion::unfused_typed<foo<vec>, vec> f;
f(1); // This works
}
{
typedef boost::fusion::vector<> vec;
boost::fusion::unfused_typed<foo<vec>, vec> f;
f(); // this fails, error message below.
}
};
1>c:\studio8\thirdparty\boost\boost\fusion\functional\adapter\detail\nullary_call_base.hpp(51)
: error C2027: use of undefined type 'foo<Sequence>::result<Sig>'
1> with
1> [
1> Sequence=vec
1> ]
1> and
1> [
1> Sig=foo<vec> (boost::fusion::vector0)
1> ]
1>
c:\studio8\thirdparty\boost\boost\fusion\functional\adapter\unfused_typed.hpp(76)
: see reference to class template instantiation
'boost::fusion::detail::nullary_call_base<Derived,Function,Enable>' being
compiled
1> with
1> [
1> Derived=boost::fusion::unfused_typed<foo<vec>,vec>,
1> Function=foo<vec>,
1> Enable=true
1> ]
1>
c:\studio8\thirdparty\boost\boost\fusion\functional\adapter\unfused_typed.hpp(86)
: see reference to class template instantiation
'boost::fusion::detail::unfused_typed_impl<D,F,S,A,EO>' being compiled
1> with
1> [
1> D=boost::fusion::unfused_typed<foo<vec>,vec>,
1> F=foo<vec>,
1> S=vec,
1> A=0,
1> EO=true
1> ]
1> c:\fail.cpp(86) : see reference to class template instantiation
'boost::fusion::unfused_typed<Function,Sequence>' being compiled
1> with
1> [
1> Function=foo<vec>,
1> Sequence=vec
1> ]
1>c:\studio8\thirdparty\boost\boost\fusion\functional\adapter\detail\nullary_call_base.hpp(58)
: error C2027: use of undefined type 'foo<Sequence>::result<Sig>'
1> with
1> [
1> Sequence=vec
1> ]
1> and
1> [
1> Sig=foo<vec> (boost::fusion::vector0)
1> ]
Regards,
Christian
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk