Boost logo

Boost Users :

Subject: Re: [Boost-users] Meaning of or_<> with empty arguments
From: Reetesh Mukul (reetesh.mukul_at_[hidden])
Date: 2008-12-14 12:16:03


Mickael Wolff <mickael <at> lupusmic.org> writes:

>
> Reetesh Mukul a écrit :
> > Hi,
> >
> > This code compiles:-
>
> If you don't have, get a book about C++ ;) . Templates can have
> default parameters like functions :
>
> template<typename LEFT = bool, typename RIGHT = bool>
> compare(LEFT, RIGHT) ;
>

;) This I know. I meant something very different.

I wanted to ask what can be the meaning of "or" operation on an empty
list/vector of parameters. Here or_<> is provided an empty set of parameters.

Now looking into code of or_<> it appears that for no-parameters, it will
inherit from false_. But when I have compiled code ( in my last mail ) using gcc
(4.1), I saw that there were no "type" inside or_<>. Typically or_<T1,T2..> has
a type in it.

Strange enough, but reasonable, or_<na,na,na> has a type inside it ( the false_
one ).

Now if suppose or_<> to false, how one is going to evaluate

typedef and_<true_,true_,or_<> > tto;

So please clear my gcc observation and the mathematical context of or_<>.

With Regards,
Reetesh Mukul


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net