C++ MPL or_, and_ implementations

Posted by KRao on Stack Overflow See other posts from Stack Overflow or by KRao
Published on 2010-12-24T18:10:09Z Indexed on 2010/12/24 19:54 UTC
Read the original article Hit count: 278

Filed under:
|
|

Hi,

I am trying to read the boost headers to figure out how they managed to implement the

or_<...> 

and

and_<...> 

metafunctions so that:

1) They can have an arbitrary number of arguments (ok, say up to 5 arguments)

2) They have short circuit behavior, for example:

or_<false_,true_,...> 

does not instantiate whatever is after true_ (so it can also be declared but not defined)

Unfortunately the pre-processor metaprogramming is making my task impossible for me :P

Thank you in advance for any help/suggestion.

© Stack Overflow or respective owner

Related posts about c++

Related posts about templates