David Abrahams wrote:
"Edward Diener"
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 ;-)
I suspected that but I couldn't figure out why you wouldn't show it. However it made it hard for me to understand how mpl::if_<> really works without understanding what actually goes there.
If you are coming to the ACCU conference in Oxford, I'll be giving a talk which describes how the MPL works in detail.
Much too far away if Oxford means England as I suspect. If it meant Mississippi I could come<g>.