[fusion] compiler errors with empty boost::tuple

I am experiencing a compiler error if I try to use a fusion join function on empty tuples. The operation I am trying to do does work with fusion::vectors. See attached; I guess this is a bug? Kind regards, Rutger ter Borg

AMDG Rutger ter Borg wrote:
I am experiencing a compiler error if I try to use a fusion join function on empty tuples. The operation I am trying to do does work with fusion::vectors. See attached; I guess this is a bug?
Patch against the trunk attached. In Christ, Steven Watanabe

Steven Watanabe wrote:
AMDG
Rutger ter Borg wrote:
I am experiencing a compiler error if I try to use a fusion join function on empty tuples. The operation I am trying to do does work with fusion::vectors. See attached; I guess this is a bug?
Patch against the trunk attached.
I don't think it's a fusion problem. Boost.Tuple should give the right answer for length<const tuple<> >. I patched Boost Tuple. I can revert if there are objections (see my other post). Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

Rutger ter Borg wrote:
I am experiencing a compiler error if I try to use a fusion join function on empty tuples. The operation I am trying to do does work with fusion::vectors. See attached; I guess this is a bug?
It's actually a boost::tuple bug. Here's the test: #include <boost/tuple/tuple.hpp> int main() { int const s = boost::tuples::length<boost::tuple<> const>::value; } The problem is that there is no specialization for const tuple<> and const null_type. I took the liberty to commit this obvious bug. I'll revert if there are objections. Here's the relevant code (tuple_basic.hpp): template<> struct length<tuple<> > { BOOST_STATIC_CONSTANT(int, value = 0); }; template<> struct length<tuple<> const> { BOOST_STATIC_CONSTANT(int, value = 0); }; template<> struct length<null_type> { BOOST_STATIC_CONSTANT(int, value = 0); }; template<> struct length<null_type const> { BOOST_STATIC_CONSTANT(int, value = 0); }; All tuple tests pass. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

Joel de Guzman wrote:
The problem is that there is no specialization for const tuple<> and const null_type.
I took the liberty to commit this obvious bug. I'll revert if there are objections. Here's the relevant code (tuple_basic.hpp):
Thanks. I've encountered another compiler error, see attached, of which I am not sure whether it is desired behaviour. Kind regards, Rutger ter Borg

Rutger ter Borg wrote:
Joel de Guzman wrote:
The problem is that there is no specialization for const tuple<> and const null_type.
I took the liberty to commit this obvious bug. I'll revert if there are objections. Here's the relevant code (tuple_basic.hpp):
Thanks. I've encountered another compiler error, see attached, of which I am not sure whether it is desired behaviour.
Fixed in SVN trunk. Thanks for the report. The problem was that fusion::iterator_facade did not have a default implementation for distance. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
participants (3)
-
Joel de Guzman
-
Rutger ter Borg
-
Steven Watanabe