如果我有一個方法,一個可選的參數作爲的boost ::可選<size_t>&=的boost ::無compilatin錯誤
boost::optional<size_t>& currentPos = boost::none;
我得到這個編譯錯誤
error: default argument for 'boost::optional<unsigned int>& currentPos' has type 'int boost::detail::none_helper::* const'
我不能用boost::none
至boost::optional<size_t>&
?
讓它升壓::可選 currentPos = boost :: none; –