mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 12:44:40 +03:00
fix: add missing semicolon in template function "add" (#18)
This commit is contained in:
@@ -616,7 +616,7 @@ int main() {
|
|||||||
```cpp
|
```cpp
|
||||||
template<typename T, typename U>
|
template<typename T, typename U>
|
||||||
auto add(T x, U y) -> decltype(x+y) {
|
auto add(T x, U y) -> decltype(x+y) {
|
||||||
return x+y
|
return x+y;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -627,7 +627,7 @@ auto add(T x, U y) -> decltype(x+y) {
|
|||||||
```cpp
|
```cpp
|
||||||
template<typename T = int, typename U = int>
|
template<typename T = int, typename U = int>
|
||||||
auto add(T x, U y) -> decltype(x+y) {
|
auto add(T x, U y) -> decltype(x+y) {
|
||||||
return x+y
|
return x+y;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user