In a desperate battle with Boost.Asio, I met many difficulties.
One of them is that I can hardly find where the "boost :: notcopyable errors" are !!
If I mistakenly violate the unavailability procedure, the IDE shows only some errors in noncopyable.hpp or elsewhere, but nowhere in my files .
I can only find errors with comments and uncomment wherever an asio object exists.
(ps: my IDE is a visual C ++ 2008, does this IDE have a bad relationship with Boost?)
EDIT:
I know that reading the error message whole helps. But what about this?
1>d:\boost\include\boost-1_42\boost\asio\basic_io_object.hpp(92) : error C2248: 'boost::noncopyable_::noncopyable::noncopyable' : cannot access private member declared in class 'boost::noncopyable_::noncopyable' 1> d:\boost\include\boost-1_42\boost\noncopyable.hpp(27) : see declaration of 'boost::noncopyable_::noncopyable::noncopyable' 1> d:\boost\include\boost-1_42\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable_::noncopyable' 1> This diagnostic occurred in the compiler generated function 'boost::asio::basic_io_object<IoObjectService>::basic_io_object(const boost::asio::basic_io_object<IoObjectService> &)' 1> with 1> [ IoObjectService=boost::asio::stream_socket_service<boost::asio::ip::tcp> ]
All this is caused by this.
tcp::socket getSocket(){ return m_socket; }
(it should be:
tcp::socket& getSocket(){ return m_socket; }
)
When there are many functions in this file, can you guys quickly find it?
(ps2: maybe all of these problems are caused by my experience with pooooooor c ++ programming?)
source share