-
Notifications
You must be signed in to change notification settings - Fork 180
unused parameters in parsers #545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
820e116
45e563a
a7c1465
d2147b3
4c25d1a
dc18c1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,7 +73,7 @@ struct FieldVariantParser { | |
|
|
||
| static schema::Type to_schema( | ||
| std::map<std::string, schema::Type>* _definitions, | ||
| std::vector<schema::Type> _types = {}) { | ||
| std::vector<schema::Type> /*_types = {}*/) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is problematic. By commenting out std::vector<schema::Type> [[maybe_unused]] _types = {}) { |
||
| using VariantType = rfl::Variant<NamedTuple<FieldTypes>...>; | ||
| return Parser<R, W, VariantType, ProcessorsType>::to_schema(_definitions); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ struct Parser<R, W, Bytestring, ProcessorsType> { | |
| } | ||
|
|
||
| static schema::Type to_schema( | ||
| std::map<std::string, schema::Type>* _definitions) { | ||
| std::map<std::string, schema::Type>* /*_definitions*/) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| return schema::Type{schema::Type::Bytestring{}}; | ||
| } | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ struct Parser<R, W, Vectorstring, ProcessorsType> { | |
| } | ||
|
|
||
| static schema::Type to_schema( | ||
| std::map<std::string, schema::Type>* _definitions) { | ||
| std::map<std::string, schema::Type>* /*_definitions*/) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| return schema::Type{schema::Type::Vectorstring{}}; | ||
| } | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While using
/*_result*/to mark a parameter as unused works, using the[[maybe_unused]]attribute is a more modern and clearer way to express this intent in C++17 and later. It makes the code more self-documenting.