Boost logo

Boost :

From: Marco Costalba (mcostalba_at_[hidden])
Date: 2007-10-02 15:05:02


On 10/2/07, Marco <mrcekets_at_[hidden]> wrote:
> On Tue, 02 Oct 2007 12:24:47 +0200, Marco Costalba <mcostalba_at_[hidden]>
>
> >
> > typedef overload_function<final, derived, head> type;
> > typedef tuples::cons<head, tuple<> > cons;
> > };
> >
> >
>
> Maybe you should replace tuple<> with tuples::null_type ...
>

I have found the error!

The problem was in

typedef tuples::cons<head, tuple<> > cons;

instead of

typedef tuples::cons<boost::function<head>, cons_tail> cons;

BTW I have pushed the product of this exercise:

http://digilander.libero.it/mcostalba/boost_overload/overload.hpp
http://digilander.libero.it/mcostalba/boost_overload/test.cpp

I have added also some stuff to let user avoid messing with indices
when he already has the functions ready to be assigned, so that he can
do this directly from the overload c'tor, see the test file if the
above line is not clear enough (and probably is not ;-)

>
> The question is :
> it's ok to use cons< cons < ... >, ..., null_type > instead of tuple type ?
>

This is a good question. I don't know the answer.

Marco


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk