crossbario/autobahn-cpp

Won't compile in MSVC as promises are not copyable.

IvaKom opened this issue · 1 comments

MSVC 2013 reasonably refuses to compile
m_register_requests[m_request_id] = register_request_t(endpoint);
in session::_provide as register_request_t has a boost::promise member that is not copyable. I've solved it with replacing the statement with
m_register_requests.emplace(std::make_pair(m_request_id, register_request_t(endpoint)));
and adding a move constructor to register_request_t:

register_request_t(register_request_t &&other) 
    : m_endpoint(std::move(other.m_endpoint))
    , m_res(std::move(other.m_res))
{}

Regards,
Ivan.

Pull request:
#28