Steven Watanabe wrote:
AMDG
On 04/07/2012 12:05 PM, Robert Ramey wrote:
That's interesting and useful. So I guess my problem is with the usage of the term "equivalent". I had interpreted this as "can be substituted for".
So I'm now thinking that my original concern is justified - that the document doesn't accurately convey what "less
" really is. Yes. I agree that the documentation needs some work here.
This has always been confusing to me - and still is. I totally get what "less
::type" is supposed to mean but the meaning and intended usage of "less " is still lost on me. Okay, I'll try to explain more clearly. mpl::less
::type is the result of invoking the metafunction. This is the way all metafunctions work in MPL so no surprises here. Now, mpl::less
is itself an MPL Integral Constant. This works because MPL Integral Constant is a Concept rather than a specific template. In other words, if you only care about the *value* of the result, and not the *exact type*, then you can use mpl::less instead of typename mpl::less ::type. Just think of this as a convenient short-cut for arithmetic metafunctions. In Christ, Steven Watanabe
great answer - next time you come up to Santa Barbara, give me a call, I'll buy you lunch. Robert Ramey