Boost logo

Boost Users :

From: Scott Meyers (usenet_at_[hidden])
Date: 2007-03-29 14:26:47


David Abrahams wrote:
> :) Not much of an advance. Try "studying my detailed elaboration" and
> let me know if that's still the case.

Things are better, thanks primarily to Joaquín M López Muñoz's helpful
explanation. Part of my confusion, I think, can be traced to the design
decision behind this comment of yours:

> mpl::set<...> may actually have a ::type
> member (essentially a typedef for mpl::set<...> itself), but if so
> it's just there as a convenience for use with constructs like eval_if.

...

> There's a class of metafunctions that usually don't need to be
> explicitly invoked: those whose range of results is limited in certain
> ways. In practice this turns out to mean metafunctions with
> numeric/boolean results.

The convenience you write of is real, but it also means that some metafunction
invocations need no ::type, but others do. Without understanding the rules in
some detail, it's hard to figure out when ::type is required. The MPL design
chooses convenience over consistency, and at the beginning of the learning
curve, my personal opinion is that consistency is more important than
convenience. For experienced users, of course, the balance point may be --
probably is -- at a different location.

Scott


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