From 00ac1d7110ee46a580dd6c5ece3722efcc9c32a5 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 28 Aug 2025 17:18:24 +0800 Subject: [PATCH 1/7] Add backticks in `std::rank` reference --- docs/standard-library/rank-class.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/standard-library/rank-class.md b/docs/standard-library/rank-class.md index 7812e4b041..1992e403c7 100644 --- a/docs/standard-library/rank-class.md +++ b/docs/standard-library/rank-class.md @@ -6,7 +6,7 @@ f1_keywords: ["type_traits/std::rank"] helpviewer_keywords: ["rank class", "rank"] ms.assetid: bc9f1b8f-800f-46ca-b6f4-d8579ed5406a --- -# rank Class +# `rank` Class Gets number of array dimensions. @@ -19,12 +19,12 @@ struct rank; ### Parameters -*Ty*\ +*`Ty`*\ The type to query. ## Remarks -The type query holds the value of the number of dimensions of the array type *Ty*, or 0 if *Ty* is not an array type. +The type query holds the value of the number of dimensions of the array type *`Ty`*, or 0 if *`Ty`* is not an array type. ## Example @@ -55,11 +55,11 @@ rank == 2 ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[](../standard-library/type-traits.md)\ -[extent Class](../standard-library/extent-class.md) +[``](../standard-library/type-traits.md)\ +[`extent` Class](../standard-library/extent-class.md) From 373eca00277f34afa73982a7bef4b689226ff244 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 28 Aug 2025 17:19:09 +0800 Subject: [PATCH 2/7] Convert "Class" to lowercase in `std::rank` reference --- docs/standard-library/rank-class.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/standard-library/rank-class.md b/docs/standard-library/rank-class.md index 1992e403c7..f5b6f45093 100644 --- a/docs/standard-library/rank-class.md +++ b/docs/standard-library/rank-class.md @@ -1,12 +1,12 @@ --- -description: "Learn more about: rank Class" -title: "rank Class" +description: "Learn more about: rank class" +title: "rank class" ms.date: "11/04/2016" f1_keywords: ["type_traits/std::rank"] helpviewer_keywords: ["rank class", "rank"] ms.assetid: bc9f1b8f-800f-46ca-b6f4-d8579ed5406a --- -# `rank` Class +# `rank` class Gets number of array dimensions. @@ -62,4 +62,4 @@ rank == 2 ## See also [``](../standard-library/type-traits.md)\ -[`extent` Class](../standard-library/extent-class.md) +[`extent` class](../standard-library/extent-class.md) From 049f4df6cd49e9cf8d8b37dfc3aa62eaa90b6c3b Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 28 Aug 2025 17:20:57 +0800 Subject: [PATCH 3/7] Rename "Parameters" heading to "Template parameters" in `std::rank` reference --- docs/standard-library/rank-class.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard-library/rank-class.md b/docs/standard-library/rank-class.md index f5b6f45093..ff7eb7dcc6 100644 --- a/docs/standard-library/rank-class.md +++ b/docs/standard-library/rank-class.md @@ -17,7 +17,7 @@ template struct rank; ``` -### Parameters +### Template parameters *`Ty`*\ The type to query. From 5b2e9fd7e1c12573088977e70ee5e27d7993a956 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 28 Aug 2025 17:23:16 +0800 Subject: [PATCH 4/7] Change `Ty` template parameter to `Type` in `std::rank` reference --- docs/standard-library/rank-class.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/standard-library/rank-class.md b/docs/standard-library/rank-class.md index ff7eb7dcc6..a8cd9863d8 100644 --- a/docs/standard-library/rank-class.md +++ b/docs/standard-library/rank-class.md @@ -13,18 +13,18 @@ Gets number of array dimensions. ## Syntax ```cpp -template +template struct rank; ``` ### Template parameters -*`Ty`*\ +*`Type`*\ The type to query. ## Remarks -The type query holds the value of the number of dimensions of the array type *`Ty`*, or 0 if *`Ty`* is not an array type. +The type query holds the value of the number of dimensions of the array type *`Type`*, or 0 if *`Type`* is not an array type. ## Example From 837eada6c2458062f96a6555e64bdfd5d09cac7b Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 28 Aug 2025 17:34:20 +0800 Subject: [PATCH 5/7] Expand example in `std::rank` reference --- docs/standard-library/rank-class.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/standard-library/rank-class.md b/docs/standard-library/rank-class.md index a8cd9863d8..386fbf155e 100644 --- a/docs/standard-library/rank-class.md +++ b/docs/standard-library/rank-class.md @@ -31,11 +31,12 @@ The type query holds the value of the number of dimensions of the array type *`T ```cpp // std__type_traits__rank.cpp // compile with: /EHsc + #include #include int main() - { +{ std::cout << "rank == " << std::rank::value << std::endl; std::cout << "rank == " @@ -43,14 +44,23 @@ int main() std::cout << "rank == " << std::rank::value << std::endl; - return (0); - } + int single_dim_array[]{ 1, 2, 3 }; + int double_dim_array[2][1]{ { 4 }, { 5 } }; + + std::cout << "\nrank == " + << std::rank::value << std::endl; + std::cout << "rank == " + << std::rank::value << std::endl; +} ``` ```Output rank == 0 rank == 1 rank == 2 + +rank == 1 +rank == 2 ``` ## Requirements From aae06296244e128cb193c7f16edd7d68568f49d4 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 28 Aug 2025 17:35:36 +0800 Subject: [PATCH 6/7] Clean up superfluous relative links in `std::rank` reference --- docs/standard-library/rank-class.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/standard-library/rank-class.md b/docs/standard-library/rank-class.md index 386fbf155e..632aa05eb5 100644 --- a/docs/standard-library/rank-class.md +++ b/docs/standard-library/rank-class.md @@ -71,5 +71,5 @@ rank == 2 ## See also -[``](../standard-library/type-traits.md)\ -[`extent` class](../standard-library/extent-class.md) +[``](type-traits.md)\ +[`extent` class](extent-class.md) From 344fa16f12fcac603bff6afd1ba20fbed4a6b13f Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 28 Aug 2025 17:36:39 +0800 Subject: [PATCH 7/7] Update metadata in `std::rank` reference --- docs/standard-library/rank-class.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/standard-library/rank-class.md b/docs/standard-library/rank-class.md index 632aa05eb5..f1c39092e5 100644 --- a/docs/standard-library/rank-class.md +++ b/docs/standard-library/rank-class.md @@ -1,10 +1,9 @@ --- -description: "Learn more about: rank class" title: "rank class" -ms.date: "11/04/2016" +description: "Learn more about: rank class" +ms.date: 08/28/2025 f1_keywords: ["type_traits/std::rank"] helpviewer_keywords: ["rank class", "rank"] -ms.assetid: bc9f1b8f-800f-46ca-b6f4-d8579ed5406a --- # `rank` class