fusion unfused_typed problem

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

Christian Holmquist wrote:
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?
Yep. Seems it hasn't been ported to support
template<> struct result<foo(Sequence)>
instead of template<> struct result<Sequence> // ... yet. Dan Marsden (who already changed most of Fusion to support that scheme) might have a (partial?) port on his disk (CCing this post Dan hoping for a status update). As my schedule has lightened up, I can just do/finish it within the next couple of days. Regards, Tobias

Tobias Schwinger wrote:
Christian Holmquist wrote:
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?
Yep. Seems it hasn't been ported to support
template<> struct result<foo(Sequence)>
instead of
template<> struct result<Sequence> // ...
yet.
Should be done now. As the docs have not been updated yet (my typing speed is lousy ITM because of an injury), take a look at the tests or ask if you experience any difficulties. Regards, Tobias

Should be done now. As the docs have not been updated yet (my typing speed is lousy ITM because of an injury), take a look at the tests or ask if you experience any difficulties.
That's great! I will update from cvs immediately. Regards, Christian On 12/07/07, Tobias Schwinger <tschwinger@isonews2.com> wrote:
Tobias Schwinger wrote:
Christian Holmquist wrote:
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?
Yep. Seems it hasn't been ported to support
template<> struct result<foo(Sequence)>
instead of
template<> struct result<Sequence> // ...
yet.
Should be done now. As the docs have not been updated yet (my typing speed is lousy ITM because of an injury), take a look at the tests or ask if you experience any difficulties.
Regards, Tobias
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Strange, I get the following error just by including unfused_typed.hpp, using VC8. #include <boost/fusion/functional/adapter/unfused_typed.hpp> 1>c:\studio8\thirdparty\boost\boost\fusion\functional\adapter\unfused_typed.hpp(93) : error C2976: 'boost::fusion::detail::nullary_call_base' : too few template arguments 1> c:\studio8\thirdparty\boost\boost\fusion\functional\adapter\detail\nullary_call_base.hpp(46) : see declaration of 'boost::fusion::detail::nullary_call_base' 1> c:\studio8\thirdparty\boost\boost\fusion\functional\adapter\unfused_typed.hpp(120) : see reference to class template instantiation 'boost::fusion::unfused_typed<Function,Sequence>' being compiled On 12/07/07, Christian Holmquist <c.holmquist@gmail.com> wrote:
Should be done now. As the docs have not been updated yet (my typing speed is lousy ITM because of an injury), take a look at the tests or ask if you experience any difficulties.
That's great!
I will update from cvs immediately.
Regards, Christian
participants (2)
-
Christian Holmquist
-
Tobias Schwinger