
Larry Evans <cppljevans@cox-internet.com> writes:
Maybe a caution like:
If the intended result of applyn<X,a1,...an>::type is X<a1,...an> then to assure this result, there should be, within the body of X, a nested:
typedef X type;
otherwise, if X<a1,...,an> has a supertype with such a nested typdef, it will be used instead of the intended result.
within:
http://www.boost.org/libs/mpl/doc/refmanual/placeholder-expression.html
would avoid misunderstandings like mine.
Maybe, but inheriting a nested ::type is such a fundamental pattern of use with MPL that I'm surprised you could have misunderstood this.
From the point of view of a client of X,
struct X { typedef int type; }; and struct Y { typedef int type; }; struct X : Y {}; are entirely equivalent. -- Dave Abrahams Boost Consulting www.boost-consulting.com