Boost logo

Boost Users :

Subject: [Boost-users] mpl documentation question
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-04-07 03:13:33


Documentation for mpl::less<T> has the following section:

Expression semantics
For any Integral Constants c1 and c2:
typedef less<c1,c2>::type r;

Return type:Integral Constant.
Semantics:Equivalent to
typedef bool_< (c1::value < c2::value) > r;

typedef less<c1,c2> r; // a

Return type:Integral Constant.
Semantics:Equivalent to
struct r : less<c1,c2>::type {}; //b

if //a is used then the following yields bool_<true>

is_same< less<c1, c2>, r>

if // b is used then the following yields bool_<false>

is_same< less<c1, c2>, r>

So in what sense are //a and // b equivalent?

Robert Ramey


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