]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpl/doc/src/refmanual/max.rst
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / mpl / doc / src / refmanual / max.rst
1 .. Metafunctions/Miscellaneous//max |90
2
3 max
4 ===
5
6 Synopsis
7 --------
8
9 .. parsed-literal::
10
11 template<
12 typename N1
13 , typename N2
14 >
15 struct max
16 {
17 typedef |unspecified| type;
18 };
19
20
21
22 Description
23 -----------
24
25 Returns the larger of its two arguments.
26
27
28 Header
29 ------
30
31 .. parsed-literal::
32
33 #include <boost/mpl/min_max.hpp>
34
35
36 Model of
37 --------
38
39 |Metafunction|
40
41
42 Parameters
43 ----------
44
45 +---------------+-------------------+-------------------------------------------+
46 | Parameter | Requirement | Description |
47 +===============+===================+===========================================+
48 | ``N1``, ``N2``| Any type | Types to compare. |
49 +---------------+-------------------+-------------------------------------------+
50
51
52 Expression semantics
53 --------------------
54
55 For arbitrary types ``x`` and ``y``:
56
57
58 .. parsed-literal::
59
60 typedef max<x,y>::type r;
61
62
63 :Return type:
64 A type.
65
66 :Precondition:
67 ``less<x,y>::value`` is a well-formed integral constant expression.
68
69 :Semantics:
70 Equivalent to
71
72 .. parsed-literal::
73
74 typedef if_< less<x,y>,y,x >::type r;
75
76
77
78 Complexity
79 ----------
80
81 Constant time.
82
83
84 Example
85 -------
86
87 .. parsed-literal::
88
89 typedef fold<
90 vector_c<int,1,7,0,-2,5,-1>
91 , int_<10>
92 , max<_1,_2>
93 >::type r;
94
95 BOOST_MPL_ASSERT(( is_same< r, int_<10> > ));
96
97
98 See also
99 --------
100
101 |Metafunctions|, |Comparison|, |min|, |less|, |max_element|
102
103
104 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
105 Distributed under the Boost Software License, Version 1.0. (See accompanying
106 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)