You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cpp/decltype-cpp.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
description: "Learn more about: decltype (C++)"
3
2
title: "decltype (C++)"
3
+
description: "Learn more about: decltype (C++)"
4
4
ms.date: 09/14/2023
5
5
f1_keywords: ["decltype_cpp"]
6
6
helpviewer_keywords: ["operators [C++], decltype", "decltype operator", "operators [C++], type of an expression", "operators [C++], deduce expression type"]
@@ -60,7 +60,7 @@ In C++11, you can use the **`decltype`** type specifier on a trailing return typ
60
60
61
61
```cpp
62
62
template<typename T, typename U>
63
-
UNKNOWN func(T&& t, U&& u){ return t + u; };
63
+
UNKNOWN func(T&& t, U&& u){ return t + u; }
64
64
```
65
65
66
66
The introduction of the **`decltype`** type specifier enables a developer to obtain the type of the expression that the function template returns. Use the *alternative function declaration syntax* that is shown later, the **`auto`** keyword, and the **`decltype`** type specifier to declare a *late-specified* return type. The late-specified return type is determined when the declaration is compiled, instead of when it's coded.
@@ -75,12 +75,12 @@ In the following code example, the late-specified return type of the `myFunc` fu
Copy file name to clipboardExpand all lines: docs/cpp/explicit-specialization-of-function-templates.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,8 @@
1
1
---
2
-
description: "Learn more about: Explicit Specialization of Function Templates"
3
2
title: "Explicit Specialization of Function Templates"
4
-
ms.date: "11/04/2016"
3
+
description: "Learn more about: Explicit Specialization of Function Templates"
4
+
ms.date: 11/04/2016
5
5
helpviewer_keywords: ["overriding, functions", "function templates, specialization", "explicit specialization of function templates", "declaring functions [C++], specialization of function template", "specialization of function templates"]
6
-
ms.assetid: eb0fcb73-eaed-42a1-9b83-14b055a34bf8
7
6
---
8
7
# Explicit Specialization of Function Templates
9
8
@@ -21,7 +20,7 @@ This declaration enables you to define a different function for **`double`** var
21
20
// explicit_specialization.cpp
22
21
template<class T> void f(T t)
23
22
{
24
-
};
23
+
}
25
24
26
25
// Explicit specialization of f with 'char' with the
0 commit comments