id summary reporter owner description type status milestone component version severity resolution keywords cc 11570 Boost 1.59.0 breaks lexical_cast to a move-only type (from a string) Tony Lewis Antony Polukhin "I think lexical_cast 1.59.0 introduces a regression over 1.58.0 because 1.58.0 allows lexical_cast from string to a move-only type but this now fails to compile. C++11 example: {{{ #!cpp #include #include #include using boost::lexical_cast; using namespace std; struct my_move_only final { string data; my_move_only() = default; my_move_only(my_move_only &&) = default; my_move_only(const my_move_only &) = delete; }; istream & operator>>(istream &arg_is, my_move_only &arg_mot) { arg_is >> arg_mot.data; return arg_is; } int main() { cerr << ""from string gives : "" << lexical_cast( string{ ""mr_carbohdrate"" } ).data << endl; } }}} This works against Boost 1.58.0 under both `g++ -std=c++11` and `clang++ -std=c++11 -stdlib=libc++` but fails against Boost 1.59.0 under both. The key compile error message appears to be: {{{ boost/lexical_cast.hpp:46:26: error: use of deleted function ‘my_move_only::my_move_only(const my_move_only&)’ return get(result); }}} (ie, you're trying to copy-construct this move-only type). It looks to me like this functionality broke with commit [https://github.com/boostorg/lexical_cast/commit/bdc355759e3259209f1107ae21babee6dcf8d80b bdc355759e]. Is it possible to keep that commit's benefits whilst restoring support for move-only types? Perhaps with some `std::move()` magic?" Bugs closed Boost 1.60.0 lexical_cast Boost 1.59.0 Regression fixed lexical_cast,move-only,1.59.0,copy constructor,regression