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

try_consume_message_until taking single parameter fails to compile #343

Closed
OleErikPeistorpet opened this issue May 5, 2021 · 2 comments
Closed
Labels
fix added A fix has been pushed to the repo and is being tested
Milestone

Comments

@OleErikPeistorpet
Copy link

This overload:

const_message_ptr try_consume_message_until(const std::chrono::time_point<Clock,Duration>&)

Gives error message:

async_client.h:696:3: error: no matching function for call to ‘mqtt::thread_queue<std::shared_ptr<const mqtt::message> >::try_get_until(mqtt::const_message_ptr&, const std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >&)’
que_->try_get_until(msg, absTime);

Simply adding an & before msg in the try_get_until call appeared to fix it.

This was discovered in version 1.1, but from what I can tell, the problem still exists in master.

@OleErikPeistorpet
Copy link
Author

Minimal example to reproduce:

#include <mqtt/async_client.h>

int main()
{
    mqtt::async_client client({}, {});
    client.try_consume_message_until(std::chrono::steady_clock::now());
}

@fpagliughi fpagliughi added this to the v1.3 milestone Nov 21, 2023
@fpagliughi fpagliughi added the fix added A fix has been pushed to the repo and is being tested label Nov 21, 2023
@fpagliughi
Copy link
Contributor

Thanks for reporting this! Sorry took a few years to get to a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix added A fix has been pushed to the repo and is being tested
Projects
None yet
Development

No branches or pull requests

2 participants