Meaning of or_<> with empty arguments

Hi,
This code compiles:-
#include

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) ; -- Mickaël Wolff aka Lupus Michaelis Racine http://lupusmic.org Blog http://blog.lupusmic.org

Mickael Wolff
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_

Reetesh Mukul a écrit :
;) This I know. I meant something very different.
Ok, but you could agree you didn't ask about the semantic :D
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.
In fact, I don't understand too. It is maybe a limitation due to the use of macro for emulating variadic templates ?
Now if suppose or_<> to false, how one is going to evaluate
I made tests too. And op_<>::operator bool() doesn't exist if we don't indicate at least one template argument. So I can't help you anymore. -- Mickaël Wolff aka Lupus Michaelis Racine http://lupusmic.org Blog http://blog.lupusmic.org
participants (2)
-
Mickael Wolff
-
Reetesh Mukul