-5
我想用std::make_pair()
爲<weak_ptr, string>
,錯誤的是:如何make_pair包括了weak_ptr
/usr/include/c++/4.8/bits/stl_pair.h:276:5: note: template<class _T1, class _T2> constexpr std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&)
make_pair(_T1&& __x, _T2&& __y)
^
/usr/include/c++/4.8/bits/stl_pair.h:276:5: note: template argument deduction/substitution failed:
.build/experimental_trusty/data_provider/Dataserver.cc:112:109: note: cannot convert 'hdl' (type 'websocketpp::connection_hdl {aka std::weak_ptr<void>}') to type 'std::weak_ptr<void>&&'
爲什麼?如何解決它?
請製作一個[最小,完整和可驗證的示例](https://stackoverflow.com/help/mcve),並顯示您已經完成的編碼嘗試。 – Akira