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
While reviewing the project code, I noticed that there are cases where class member functions are declared with static inline. However, in modern C++(since C++17), the semantics of inline has changed. For class member functions, simply using static is sufficient to achieve a similar effect and is more concise and in line with modern C++ standards.
For more detailed explanations, please refer to: cppref. It is recommended that developers consider adjusting such declarations in the code to optimize the code structure and adhere to more appropriate programming practices.
The text was updated successfully, but these errors were encountered:
lovelxc
changed the title
Recommendation on Class Member Function Declaration
proposal: Recommendation on Class Member Function Declaration
Nov 23, 2024
While reviewing the project code, I noticed that there are cases where class member functions are declared with
static inline
. However, in modern C++(since C++17), the semantics of inline has changed. For class member functions, simply usingstatic
is sufficient to achieve a similar effect and is more concise and in line with modern C++ standards.For more detailed explanations, please refer to: cppref. It is recommended that developers consider adjusting such declarations in the code to optimize the code structure and adhere to more appropriate programming practices.
The text was updated successfully, but these errors were encountered: