标头中的“ void f(auto){}”是否需要“内联”?

问题描述 投票:3回答:1

考虑

template<typename T>
inline void f(T) {} // "inline" can be safely removed.

inline void f(auto) {} // Can "inline" also be safely removed?

根据C ++标准,可以inline在后一种情况下可以安全删除吗?

c++ templates inline auto c++20
1个回答
1
投票

来自[dcl.fct]/18

© www.soinside.com 2019 - 2024. All rights reserved.