]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/doc/rank.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / type_traits / doc / rank.qbk
CommitLineData
7c673cae
FG
1[/
2 Copyright 2007 John Maddock.
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at
5 http://www.boost.org/LICENSE_1_0.txt).
6]
7
8[section:rank rank]
9 template <class T>
10 struct rank : public __integral_constant<std::size_t, RANK(T)> {};
11
12__inherit Class template rank inherits from `__integral_constant<std::size_t, RANK(T)>`,
13where `RANK(T)` is the number of array dimensions in type `T`.
14
15If `T` is not a (built-in) array type, then `RANK(T)` is zero.
16
17[all_compilers]
18
19__header ` #include <boost/type_traits/rank.hpp>` or ` #include <boost/type_traits.hpp>`
20
21__examples
22
23[:`rank<int[]>` inherits from `__integral_constant<std::size_t, 1>`.]
24
25[:`rank<double[2][3][4]>::type` is the type `__integral_constant<std::size_t, 3>`.]
26
27[:`rank<int[1]>::value` is an integral constant
28expression that evaluates to /1/.]
29
30[:`rank<int[][2]>::value` is an integral constant
31expression that evaluates to /2/.]
32
33[:`rank<int*>::value` is an integral constant
34expression that evaluates to /0/.]
35
36[:`rank<boost::array<int, 3> >::value` is an integral constant
37expression that evaluates to /0/: `boost::array` is a class type and [*not an array type]!]
38
39[:`rank<T>::value_type` is the type `std::size_t`.]
40
41[endsect]
42