Back to Arangodb

max

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/max.html

3.12.9.12.2 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / Miscellaneous / max |

max

Synopsis

template<
      typename N1
    , typename N2
    >
struct[max](./max.html){
    typedef_unspecified_type;
};

Description

Returns the larger of its two arguments.

#include <[boost/mpl/min\_max.hpp](../../../../boost/mpl/min_max.hpp)>

Model of

Metafunction

Parameters

ParameterRequirementDescription
N1, N2Any typeTypes to compare.

Expression semantics

For arbitrary types x and y:

typedef[max](./max.html)<x,y>::type r;

| Return type: |

A type.

| | Precondition: |

less<x,y>::value is a well-formed integral constant expression.

| | Semantics: |

Equivalent to

typedef[if\_](./if.html)<[less](./less.html)<x,y>,y,x >::type r;

|

Complexity

Constant time.

Example

typedef[fold](./fold.html)<[vector\_c](./vector-c.html)<int,1,7,0,-2,5,-1>
    ,[int\_](./int.html)<10>
    ,[max](./max.html)<[\_1](./placeholders.html),[\_2](./placeholders.html)>
    >::type r;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same< r,[int\_](./int.html)<10> > ));

See also

Metafunctions, comparison, min, less, max_element

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |