Skip to content
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

added [[maybe_unused]] in some places where it was needed #856

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/dpp/collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ template<class T, class C> class collector
stored.push_back(*v);
}
};
tl = new dpp::timed_listener<event_router_t<T>, std::function<void(const T&)>>(cl, duration, event, f, [this](dpp::timer timer_handle) {
tl = new dpp::timed_listener<event_router_t<T>, std::function<void(const T&)>>(cl, duration, event, f, [this]([[maybe_unused]] dpp::timer timer_handle) {
if (!triggered) {
triggered = true;
completed(stored);
Expand Down
4 changes: 2 additions & 2 deletions include/dpp/json_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace dpp {
* @param j nlohmann::json object
* @return T& Reference to self for fluent calling
*/
T& fill_from_json(nlohmann::json* j) {
T& fill_from_json([[maybe_unused]] nlohmann::json* j) {
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
throw dpp::logic_exception("JSON interface doesn't implement parse_from_json");
}

Expand All @@ -54,7 +54,7 @@ namespace dpp {
* @param with_id Include the ID in the JSON
* @return std::string JSON string version of object
*/
virtual std::string build_json(bool with_id = false) const {
virtual std::string build_json([[maybe_unused]] bool with_id = false) const {
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
throw dpp::logic_exception("JSON interface doesn't implement build_json");
}
};
Expand Down
2 changes: 1 addition & 1 deletion include/dpp/timed_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ template <typename attached_event, class listening_function> class timed_listene
/* Attach event */
listener_handle = ev(listener);
/* Create timer */
th = cl->start_timer([this](dpp::timer timer_handle) {
th = cl->start_timer([this]([[maybe_unused]] dpp::timer timer_handle) {
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
/* Timer has finished, detach it from event.
* Only allowed to tick once.
*/
Expand Down