
-------- Original-Nachricht -------- Betreff: [move] problem with msvc-10 (BOOST_MOVABLE_BUT_NOT_COPYABLE) Datum: Wed, 24 Nov 2010 20:56:46 +0100 Von: Oliver Kowalke <oliver.kowalke@gmx.de> An: boost@lists.boost.org Hi, msvc-10 has some problems with boost.move. linker error: LNK2019: unresolved symbol "private __cdecl X::X(class X const&)" Example doc_file_descriptor.cpp (uses BOOST_MOVABLE_BUT_NOT_COPYABLE) does not compile too. g++-4.4.5 accepts the code. ? thx, Oliver #include <boost/move/move.hpp> #include <boost/shared_ptr.hpp> class X { private: BOOST_MOVABLE_BUT_NOT_COPYABLE( X); struct impl_t {}; boost::shared_ptr< impl_t > impl_; X( boost::shared_ptr< impl_t > const& impl); public: X(); static X create(); X( BOOST_RV_REF( X) other); X & operator=( BOOST_RV_REF( X) other); void swap( X & other); }; X::X() : impl_() {} X::X( boost::shared_ptr< impl_t > const& impl) : impl_( impl) {} X X::create() { boost::shared_ptr< impl_t > impl( new impl_t() ); return X( impl); } X::X( BOOST_RV_REF( X) other) : impl_() { impl_.swap( other.impl_); } X & X::operator=( BOOST_RV_REF( X) other) { if ( this != & other) { X tmp( other); swap( tmp); } return * this; } void X::swap( X & other) { impl_.swap( other.impl_); } int main(int argc, char * argv[]) { X x( X::create() ); return 0; }