|
13 | 13 |
|
14 | 14 | #line 2 "pure2-template-parameter-lists.cpp2"
|
15 | 15 | template<typename T, typename U> [[nodiscard]] auto f1(T const& t, U const& u) -> auto;
|
16 |
| - |
17 |
| - |
18 |
| -#line 6 "pure2-template-parameter-lists.cpp2" |
19 | 16 | template<typename T, typename U> [[nodiscard]] auto f2(T const& t, U const& u) -> auto;
|
20 |
| - |
21 |
| - |
22 |
| -#line 10 "pure2-template-parameter-lists.cpp2" |
23 | 17 | template<auto T, auto U> [[nodiscard]] auto f3() -> auto;
|
24 |
| - |
25 |
| - |
26 |
| -#line 14 "pure2-template-parameter-lists.cpp2" |
27 | 18 | template<cpp2::i8 T, cpp2::i16 U> [[nodiscard]] auto f4() -> auto;
|
28 |
| - |
29 | 19 |
|
30 |
| -#line 18 "pure2-template-parameter-lists.cpp2" |
31 | 20 | auto main() -> int;
|
32 | 21 |
|
33 | 22 |
|
34 | 23 | //=== Cpp2 function definitions =================================================
|
35 | 24 |
|
36 | 25 |
|
37 | 26 | #line 2 "pure2-template-parameter-lists.cpp2"
|
38 |
| -template<typename T, typename U> [[nodiscard]] auto f1(T const& t, U const& u) -> auto{ |
39 |
| - return t + u; |
40 |
| -} |
41 |
| - |
42 |
| -template<typename T, typename U> [[nodiscard]] auto f2(T const& t, U const& u) -> auto{ |
43 |
| - return t + u; |
44 |
| -} |
45 |
| - |
46 |
| -template<auto T, auto U> [[nodiscard]] auto f3() -> auto{ |
47 |
| - return T + U; |
48 |
| -} |
49 |
| - |
50 |
| -template<cpp2::i8 T, cpp2::i16 U> [[nodiscard]] auto f4() -> auto{ |
51 |
| - return T + U; |
52 |
| -} |
| 27 | + template<typename T, typename U> [[nodiscard]] auto f1(T const& t, U const& u) -> auto { return t + u; } |
| 28 | +template<typename T, typename U> [[nodiscard]] auto f2(T const& t, U const& u) -> auto { return t + u; } |
| 29 | +template<auto T, auto U> [[nodiscard]] auto f3() -> auto { return T + U; } |
| 30 | +template<cpp2::i8 T, cpp2::i16 U> [[nodiscard]] auto f4() -> auto { return T + U; } |
53 | 31 |
|
54 | 32 | auto main() -> int{
|
55 | 33 | std::cout << "f1: " + cpp2::to_string(f1(1, 1)) + "\n";
|
|
0 commit comments