Description
Currently, the codebase uses commented-out parameter names (e.g., /*context*/) to indicate unused parameters. This should be replaced with the standard C++17 [[maybe_unused]] attribute for better code clarity and consistency.
Current Pattern
auto sleep_test(spider::TaskContext& /*context*/, int milliseconds) -> int {
std::this_thread::sleep_for(std::chrono::milliseconds{milliseconds});
return milliseconds;
}
Proposed Pattern
auto sleep_test([[maybe_unused]] spider::TaskContext& context, int milliseconds) -> int {
std::this_thread::sleep_for(std::chrono::milliseconds{milliseconds});
return milliseconds;
}
Benefits
- Uses standard C++17 attribute instead of comments
- Clearer intent and better compiler support
- Consistent with modern C++ practices
- Maintains parameter names for documentation purposes
Scope
Based on initial analysis, this pattern appears throughout the codebase in various test files and implementation files.
References
cc: @sitaowang1998
Description
Currently, the codebase uses commented-out parameter names (e.g.,
/*context*/) to indicate unused parameters. This should be replaced with the standard C++17[[maybe_unused]]attribute for better code clarity and consistency.Current Pattern
Proposed Pattern
Benefits
Scope
Based on initial analysis, this pattern appears throughout the codebase in various test files and implementation files.
References
cc: @sitaowang1998