2002-09-16 19:25:33 +00:00
<!doctype html public "-//ietf//dtd html//en">
2003-03-12 13:29:12 +00:00
< html > < head > < title > boost::mpl::less< / title >
2002-09-16 19:25:33 +00:00
< link rel = "stylesheet" href = "../mpl_wiki.css" >
< / head > < body bgcolor = "white" >
2003-03-12 13:29:12 +00:00
< h1 > < a href = "../Table_of_Contents.html" > < img src = "../mpl_logo.jpg" alt = "[Home]" border = 0 align = "right" > < / a > less< / h1 > < h3 > Synopsis< / h3 >
2002-09-16 19:25:33 +00:00
< p >
< pre >
template<
typename T1
2003-03-12 13:29:12 +00:00
, typename T2
2002-09-16 19:25:33 +00:00
>
struct less
{
typedef < em > unspecified< / em > type;
};
< / pre >
< p >
< h3 > Description< / h3 >
< p >
2003-03-12 13:29:12 +00:00
Returns < code > true_< / code > if < code > T1::value < T2::value< / code > and < code > false_< / code > otherwise [< a href = "#1" > 1< / a > ].
2002-09-16 19:25:33 +00:00
< p >
< h3 > Definition< / h3 >
< p >
< pre >
2003-03-12 13:29:12 +00:00
#include "< a href = "../../../../../boost/mpl/less.hpp" > boost/mpl/less.hpp< / a > "
2002-09-16 19:25:33 +00:00
< / pre >
< p >
< h3 > Parameters< / h3 >
< table border = "1" >
< tr > < th > Parameter < / th > < th > Requirement < / th > < th > Description < / th > < / tr >
< tr > < td > < code > T1, T2< / code > < / td > < td > A model of < a href = "../Integral_Constant.html" > Integral Constant< / a > < / td > < td > < / td > < / tr >
< / table >
< p >
< h3 > Expression semantics< / h3 >
< p >
< table border = "1" >
< tr > < th > Expression < / th > < th > Expression type < / th > < th > Precondition < / th > < th > Semantics < / th > < th > Postcondition < / th > < / tr >
2003-03-12 13:29:12 +00:00
< tr > < td > < code > typedef less< t1,t2> ::type c;< / code > < / td > < td > A model of < code > bool< / code > < a href = "../Integral_Constant.html" > Integral Constant< / a > < / td > < td > < / td > < td > Equivalent to < code > typedef bool_< (t1::value < t2::value)> c;< / code > < / td > < td > < / td > < / tr >
2002-09-16 19:25:33 +00:00
< / table >
< p >
< h3 > Complexity< / h3 >
< p >
Amortized constant time.
< p >
< h3 > Example< / h3 >
< p >
< pre >
typedef < a href = "../Reference/list_c.html" > list_c< / a > < int,0,1,2,3,4,5,6,7,8,9> numbers;
2003-03-12 13:29:12 +00:00
typedef < a href = "../Reference/remove_if.html" > remove_if< / a > < numbers, less< _1,int_< 5> > > ::type result;
BOOST_STATIC_ASSERT(< a href = "../Reference/equal.html" > equal< / a > < result,< a href = "../Reference/range_c.html" > range_c< / a > < int,5,10> > ::type::value));
2002-09-16 19:25:33 +00:00
< / pre >
< p >
< h3 > Notes< / h3 >
< p >
[< a name = "1" > 1< / a > ] The < code > less< / code > metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the < a href = "../Integral_Constant.html" > Integral Constant< / a > requirements. The requirements listed here are the ones imposed by the default implementation.< br >
< p >
< h3 > See also< / h3 >
< p >
< a href = "../Metafunctions.html" > Metafunctions< / a > , < code > < a href = "../Reference/less_equal.html" > less_equal< / a > < / code > , < code > < a href = "../Reference/greater.html" > greater< / a > < / code > , < code > < a href = "../Reference/greater_equal.html" > greater_equal< / a > < / code > , < code > < a href = "../Reference/equal.html" > equal< / a > < / code > , < code > < a href = "../Reference/not_equal_to.html" > not_equal_to< / a > < / code >
< p > < hr >
2003-03-12 13:29:12 +00:00
< a href = "../Table_of_Contents.html" > Table of Contents< / a > < br > Last edited March 10, 2003 6:22 am< / body > < / html >