Steven Watanabe wrote:
AMDG
On 04/07/2012 10:47 AM, Robert Ramey wrote:
Vicente J. Botet Escriba wrote:
Le 07/04/12 09:13, Robert Ramey a écrit :
Documentation for mpl::less<T> has the following section:
typedef less
r; // a Return type:Integral Constant. Semantics:Equivalent to struct r : less
::type {}; //b if //a is used then the following yields bool_<true>
is_same< less
, r> if // b is used then the following yields bool_<false>
is_same< less
, r> So in what sense are //a and // b equivalent?
<snip> So you agree that the statement above (which appears in the documentation)
typedef less
r; // a Return type:Integral Constant. Semantics:Equivalent to struct r : less
::type {}; //b is incorrect and misleading?
I'm thinking that it shouldn't even be in the documentation as written. This raises the question as to what the documentation should say about the type "less
" ? is_same doesn't work, but what you can use is mpl::equal_to. mpl::equal_to compares integral constants for equality without requiring the types to match exactly:
equal_to
, r> -> mpl::true_
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
In Christ, Steven Watanabe