Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-31 14:11:28


"Edward Diener" <eddielee_at_[hidden]> writes:

> I am trying to understand how the MPL library works. I first read "The Boost
> C++ Metaprogramming Library" by Aleksey Gurtovoy and David Abrahams. When I
> get to Basic Usage I see this:
>
> template<
> typename Condition
> , typename T1
> , typename T2
> >
> struct if_
> {
> typedef /*unspecified*/ type;
> };
>
> I am really having trouble understanding the next to last line. How can
> "typedef type;" be a valid C++ construct and,

It's not.

> if it is, what does it mean ?

There's an unspecified type-expression which goes where the
/*unspecified*/ comment is.

> I always though that a typedef must specify an actual type but I
> don't see any in the expression above.

The point is that we're not showing it to you ;-)

If you are coming to the ACCU conference in Oxford, I'll be giving a
talk which describes how the MPL works in detail.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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