]> git.proxmox.com Git - ceph.git/blame - 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
CommitLineData
7c673cae
FG
1.. Metafunctions/Miscellaneous//max |90
2
3max
4===
5
6Synopsis
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
22Description
23-----------
24
25Returns the larger of its two arguments.
26
27
28Header
29------
30
31.. parsed-literal::
32
33 #include <boost/mpl/min_max.hpp>
34
35
36Model of
37--------
38
39|Metafunction|
40
41
42Parameters
43----------
44
45+---------------+-------------------+-------------------------------------------+
46| Parameter | Requirement | Description |
47+===============+===================+===========================================+
48| ``N1``, ``N2``| Any type | Types to compare. |
49+---------------+-------------------+-------------------------------------------+
50
51
52Expression semantics
53--------------------
54
55For 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
78Complexity
79----------
80
81Constant time.
82
83
84Example
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
98See also
99--------
100
101|Metafunctions|, |Comparison|, |min|, |less|, |max_element|
102
103
104