但它崩溃了:
From the console:
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/debug/safe_iterator.h:127:
error: attempt to copy-construct an iterator from a singular iterator.
Objects involved in the operation:
iterator "this" @ 0x0x100420 {
type = N11__gnu_debug14_Safe_iteratorIN10__gnu_norm14_List_iteratorISt4pairIiPN5boost4asio6detail16reactor_op_queueIiE7op_baseEEEEN15__gnu_debug_def4listISB_SaISB_EEEEE
(mutable iterator);
state = singular;
}
iterator "other" @ 0x0xbfffee64 {
type = N11__gnu_debug14_Safe_iteratorIN10__gnu_norm14_List_iteratorISt4pairIiPN5boost4asio6detail16reactor_op_queueIiE7op_baseEEEEN15__gnu_debug_def4listISB_SaISB_EEEEE
(mutable iterator);
state = singular;
}
Program received signal: âSIGABRTâ.
从回溯:
(gdb) bt
__gnu_debug::_Safe_iterator<__gnu_norm::_List_iterator<std::pair<int,
boost::asio::detail::reactor_op_queue<int>::op_base*> >,
__gnu_debug_def::list<std::pair<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>,
std::allocator<std::pair<int,
boost::asio::detail::reactor_op_queue<int>::op_base*> > >
>::_Safe_iterator (this=0x100420, __x=@0xbfffee64) at
debug/safe_iterator.h:124
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type::bucket_type
(this=0x100420) at hash_map.hpp:277
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
(__p=0x100420, __value=@0xbfffee64) at stl_construct.h:81
std::__uninitialized_fill_n_aux<__gnu_cxx::__normal_iterator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type*,
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> >
>, unsigned long, boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
(__first={_M_current = 0x100420}, __n=3, __x=@0xbfffee64) at
stl_uninitialized.h:194
std::uninitialized_fill_n<__gnu_cxx::__normal_iterator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type*,
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> >
>, unsigned long, boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
(__first={_M_current = 0x100420}, __n=3, __x=@0xbfffee64) at
stl_uninitialized.h:218
std::__uninitialized_fill_n_a<__gnu_cxx::__normal_iterator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type*,
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type> >
>, unsigned long, boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
(__first={_M_current = 0x100420}, __n=3, __x=@0xbfffee64) at
stl_uninitialized.h:310
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
>::_M_fill_insert (this=0x1002f0, __position={_M_current = 0x0},
__n=3, __x=@0xbfffee64) at vector.tcc:365
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
>::insert (this=0x1002f0, __position={_M_current = 0x0}, __n=3,
__x=@0xbfffee64) at stl_vector.h:658
__gnu_norm::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
>::resize (this=0x1002f0, __new_size=3, __x=@0xbfffee64) at
stl_vector.h:427
__gnu_debug_def::vector<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type,
std::allocator<boost::asio::detail::hash_map<int,
boost::asio::detail::reactor_op_queue<int>::op_base*>::bucket_type>
>::resize (this=0x1002f0, __sz=3, __c=@0xbfffee64) at debug/vector:169
boost::asio::detail::reactor_op_queue<int>::op_base*>::rehash
(this=0x1002c4, num_buckets=3) at hash_map.hpp:221
boost::asio::detail::reactor_op_queue<int>::op_base*>::hash_map
(this=0x1002c4) at hash_map.hpp:67
boost::asio::detail::reactor_op_queue<int>::reactor_op_queue
(this=0x1002c0) at reactor_op_queue.hpp:42
boost::asio::detail::kqueue_reactor<false>::kqueue_reactor
(this=0x100270, io_service=@0xbffff7a4) at kqueue_reactor.hpp:86
boost::asio::detail::service_registry::use_service<boost::asio::detail::kqueue_reactor<false>
> (this=0x100180) at service_registry.hpp:109
boost::asio::use_service<boost::asio::detail::kqueue_reactor<false> >
(ios=@0xbffff7a4) at impl/io_service.ipp:195
boost::asio::detail::reactive_socket_service<boost::asio::ip::udp,
boost::asio::detail::kqueue_reactor<false> >::reactive_socket_service
(this=0x100250, io_service=@0xbffff7a4) at
reactive_socket_service.hpp:111
boost::asio::detail::service_registry::use_service<boost::asio::detail::reactive_socket_service<boost::asio::ip::udp,
boost::asio::detail::kqueue_reactor<false> > > (this=0x100180) at
service_registry.hpp:109
boost::asio::use_service<boost::asio::detail::reactive_socket_service<boost::asio::ip::udp,
boost::asio::detail::kqueue_reactor<false> > > (ios=@0xbffff7a4) at
impl/io_service.ipp:195
boost::asio::datagram_socket_service<boost::asio::ip::udp>::datagram_socket_service
(this=0x100230, io_service=@0xbffff7a4) at
datagram_socket_service.hpp:95
boost::asio::detail::service_registry::use_service<boost::asio::datagram_socket_service<boost::asio::ip::udp>
> (this=0x100180) at service_registry.hpp:109
boost::asio::use_service<boost::asio::datagram_socket_service<boost::asio::ip::udp>
> (ios=@0xbffff7a4) at impl/io_service.ipp:195
boost::asio::basic_io_object<boost::asio::datagram_socket_service<boost::asio::ip::udp>
>::basic_io_object (this=0xbffff6a4, io_service=@0xbffff7a4) at
basic_io_object.hpp:72
boost::asio::datagram_socket_service<boost::asio::ip::udp>
>::basic_socket (this=0xbffff6a4, io_service=@0xbffff7a4,
endpoint=@0xbffff6b8) at basic_socket.hpp:108
boost::asio::basic_datagram_socket<boost::asio::ip::udp,
boost::asio::datagram_socket_service<boost::asio::ip::udp>
>::basic_datagram_socket (this=0xbffff6a4, io_service=@0xbffff7a4,
endpoint=@0xbffff6b8) at basic_datagram_socket.hpp:107
/Users/n179911/Documents/ServerXCode/main.cpp:21
/Users/n179911/Documents/ServerXCode/main.cpp:47
(gdb)
有人知道吗?