Skip to content

Commit 9297548

Browse files
更正 index.md 中缺失 staticconstexpr 成员变量
注意这里我们在讨论 C++17,类内的 `static` `constexpr` 成员已经蕴含了 `inline`,从而只需要写 `static` 即可。
1 parent a286f4d commit 9297548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ void try_call_foo(T &t) {
9898
```cpp
9999
template <class T, class = void>
100100
struct has_foo {
101-
inline constexpr bool value = false;
101+
static constexpr bool value = false;
102102
};
103103
104104
template <class T>
105105
struct has_foo<T, std::void_t<decltype(std::declval<T>().foo())>> {
106-
inline constexpr bool value = true;
106+
static constexpr bool value = true;
107107
};
108108
109109
template <class T>

0 commit comments

Comments
 (0)