-
Notifications
You must be signed in to change notification settings - Fork 111
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
Support for BOOST_ASIO_NO_DEPRECATED #409
Comments
I just recognized the issue now. The minimum boost requirement is 1.66.0 on the master branch. If it does, I will update step by step. But priority is not so high because I have other higher priority issues. |
@ropieur , do you know where |
You should look at here |
I found a bug in const_buffer_util.hpp |
|
@ropieur , thank you very much! Your comment would save my time a lot. I will fix BOOST_VERSION bug separately and immediately. |
#413 fixes BOOST_VERSION problem. |
@jonesmz , I will create a PR that support |
Alright, sounds good to me. |
#268 is related issue. I think that the following step is good:
|
@jonesmz , I think that the series of enum class pull requests have been merged. Is that right? I will start implementing BOOST_ASIO_NO_DEPRECATED support. |
Yes. Go ahead. |
I got compile error as follows:
candidate templates
It seems that null strand needs to meet executor concept. I'm looking for a good way to do that but it's complicated. If someone know the way, please tell me. Note: null_strand is do nothing strand. It is used to remove strand if dispatch in endpoint code. |
The error is reported ad modified The essence of the code is as follows: template <typename Socket, typename Strand>
class tcp_endpoint {
public:
...
template <typename MutableBufferSequence, typename ReadHandler>
void async_read(
MutableBufferSequence && buffers,
ReadHandler&& handler) {
as::async_read(
tcp_,
std::forward<MutableBufferSequence>(buffers),
as::bind_executor( // ****** here
strand_,
std::forward<ReadHandler>(handler)
)
);
}
|
I solved the error. namespace MQTT_NS {
namespace as = boost::asio;
struct null_strand {
null_strand(as::io_context& ioc) noexcept : ioc_(ioc) {}
template <typename Func, typename Allocator>
void post(Func&& f, Allocator) const {
as::post(
ioc_,
[f = std::forward<Func>(f)] () mutable {
std::forward<Func>(f)();
}
);
}
template <typename Func, typename Allocator>
void defer(Func&& f, Allocator) const {
as::defer(
ioc_,
[f = std::forward<Func>(f)] () mutable {
std::forward<Func>(f)();
}
);
}
template <typename Func, typename Allocator>
void dispatch(Func&& f, Allocator) const {
std::forward<Func>(f)();
}
void on_work_started() const noexcept {}
void on_work_finished() const noexcept {}
as::io_context& context() noexcept{ return ioc_; }
as::io_context const& context() const noexcept { return ioc_; }
private:
as::io_context& ioc_;
};
inline bool operator==(null_strand const& lhs, null_strand const& rhs) {
return std::addressof(lhs) == std::addressof(rhs);
}
inline bool operator!=(null_strand const& lhs, null_strand const& rhs) {
return !(lhs == rhs);
}
} // namespace MQTT_NS
namespace boost {
namespace asio {
template<>
struct is_executor<MQTT_NS::null_strand> : std::true_type {
};
} // namespace asio
} // namespace boost |
I sent the PR to fix the issue as #419. Could you check this? |
I reopen #345. I close the issue. |
Impossible for me to elude the #define BOOST_ASIO_NO_DEPRECATED.
Is there any plan to upgrade the code in a near future?
The text was updated successfully, but these errors were encountered: