[Home]greater_equal

Synopsis

template<
      typename T1
    , typaname T2
    >
struct greater_equal
{
    typedef unspecified type;
};

Description

Returns true_c if T1::value > T2::value and false_c otherwise [1].

Definition

#include "boost/mpl/comparison/greater_equal.hpp"

Parameters

 Parameter  Requirement  Description  
T1, T2A model of Integral Constant

Expression semantics

 Expression  Expression type  Precondition  Semantics  Postcondition 
typedef greater_equal<t1,t2>::type c;A model of bool Integral ConstantEquivalent to typedef bool_c<(t1::value >= t2::value)> c;

Complexity

Amortized constant time.

Example

typedef list_c<int,0,1,2,3,4,5,6,7,8,9> numbers;
typedef remove_if< numbers, greater_equal<_,int_c<5> > >::type result;
BOOST_STATIC_ASSERT(equal< result,range_c<int,0,5>,equal_to<_,_> >::type::value));

Notes

[1] The greater_equal metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the Integral Constant requirements. The requirements listed here are the ones imposed by the default implementation.

See also

Metafunctions, greater, less, less_equal, equal_to, not_equal_to


Table of Content | Reference
Last edited July 17, 2002 4:16 am