vector<_Tp, _Alloc>:: reserve(size_type __n) {if(__n >this->max_size()) __throw_length_error(__N("vector::reserve"));if(this->capacity() < __n) {constsize_type __old_size = size(); pointer __tmp = _M_allocate_and_copy(__n, _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(...
源码如下 template <class_Tp,class_Alloc>voidvector<_Tp, _Alloc>::reserve(size_type __n) {if(capacity() <__n) {if(max_size() <__n) {this->_M_throw_length_error(); }constsize_type __old_size =size(); pointer __tmp;if(this->_M_start) { __tmp= _M_allocate_and_copy(_...
voidreserve(size_type _n){if(__n>max_size())__throw_length_error(__N("vector::reserve"));if(capacity()<__n)_M_reallocate(__n);}
需要注意的是,resize和reserve函数在容器类型上的可用性有所不同。...resize函数对于大多数容器类型是可用的,而reserve函数只对具有动态大小的容器类型有效,例如std::vector和std::deque。...(size_type _n) { if (__n > max_size()) __throw_length_error(__N("vector::reserve")); if ( ...
T is the first template parameter (the type of the elements stored in the vector).Return Value none If a reallocation happens, it is performed using Allocator::allocate(), which may throw exceptions (for the default allocator, bad_alloc is thrown if the allocation request does not succeed)....
strWalletPass = params[0].get_str().c_str();if(strWalletPass.length() <1)throwruntime_error("encryptwallet <passphrase>\n""Encrypts the wallet with <passphrase>.");if(!pwalletMain->EncryptWallet(strWalletPass))throwJSONRPCError(RPC_WALLET_ENCRYPTION_FAILED,"Error: Failed to encrypt th...
Throwsstd::length_errorifnew_capis greater thanmax_size(). May throw any exceptions thrown bystd::allocator_traits<Allocator>::allocate(), such asstd::bad_alloc. If an exception is thrown for any reason, this function has no effect (strong exception safety guarantee). ...
If the requested size to allocate is greater than the maximum size (vector::max_size) alength_errorexception is thrown. In case of reallocation, this is performed usingAllocator::allocate(), which may throw its own exceptions (for the defaultallocator,bad_allocis thrown if the allocation reque...
[code||"throw new Error('code not found!');"],{type:"application/javascript"}),url=URL.createObjectURL(blob);window.mainThread={webWorker:new Worker(url)};window.vwoChannelFW=new MessageChannel();window.vwoChannelToW=new MessageChannel();window.mainThread.webWorker.postMessage({vwoChannelToW...
vwo_debug*/el=ctx,vwo_$("#main").not('[vwo-op-1734722847553=""]').length&&el.each((function(){vwo_$(this).find("script").remove();var o=vwo_$("#main"),t=vwo_$("#main > .form");o.length&&o.attr("vwo-op-1734722847553",""),t.length?t.before(this):o.append(this)})...