<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>不敢流泪 &#187; DHTML</title>
	<atom:link href="http://www.boluor.com/tag/dhtml/feed" rel="self" type="application/rss+xml" />
	<link>http://www.boluor.com</link>
	<description></description>
	<lastBuildDate>Fri, 07 Oct 2011 07:28:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>[临时]测试codeHilight</title>
		<link>http://www.boluor.com/temptesting-codehilight.html</link>
		<comments>http://www.boluor.com/temptesting-codehilight.html#comments</comments>
		<pubDate>Wed, 05 Aug 2009 17:11:29 +0000</pubDate>
		<dc:creator>Sandy</dc:creator>
				<category><![CDATA[程序设计]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.boluor.com/?p=231</guid>
		<description><![CDATA[测试codeHilighter啦～]]></description>
			<content:encoded><![CDATA[<p><b>测试代码喽：</b><br />
<br/>codeHilighter by sandy_zc_1 。<br/>应boluor要求拿来替换掉该死的奇慢无比臃肿不堪的syntaxhighlighter。<br/><br />
<script language="javascript" src="http://www.boluor.com/wp-content/plugins/codeh1/codeh.js" type="text/javascript"></script><br />
<script language="javascript" src="http://www.boluor.com/wp-content/plugins/codeh1/chcommon.js" type="text/javascript"></script></p>
<link rel="stylesheet" href="http://www.boluor.com/wp-content/plugins/syntaxhighlighter-plus/syntaxhighlighter/styles/shCore.css" type="text/css" media="screen" />
<p><b>JS代码：</b></p>
<div id="cdh_js1" class="dCodeH1">
function Space(n)<br/>{<br/>&nbsp;&nbsp;&nbsp; if(n&gt;3)<br/>&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var str1=Space3(Math.floor(n/2));<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; str1+=str1;<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(n%2!=0){ return str1+&quot; &quot;;}<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else { return str1;}<br/>&nbsp;&nbsp;&nbsp; }else if(n==3)<br/>&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return &quot; &nbsp; &quot;;<br/>&nbsp;&nbsp;&nbsp; }else if(n==2)<br/>&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return &quot; &nbsp;&quot;;<br/>&nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp; return &quot; &quot;;<br/>}
</div>
<p><script language="javascript" >CodeHilight(document.getElementById("cdh_js1"),"JS");</script><br />
<span id="more-231"></span><br />
<b>C++代码：</b></p>
<div id="cdh_cpp1" class="dCodeH1">
// Vector implementation (out of line) -*- C++ -*-<br/><br/>// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.<br/>//<br/>// This file is part of the GNU ISO C++ Library. &nbsp;This library is free<br/>// software; you can redistribute it and/or modify it under the<br/>// terms of the GNU General Public License as published by the<br/>// Free Software Foundation; either version 2, or (at your option)<br/>// any later version.<br/><br/>// This library is distributed in the hope that it will be useful,<br/>// but WITHOUT ANY WARRANTY; without even the implied warranty of<br/>// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the<br/>// GNU General Public License for more details.<br/><br/>// You should have received a copy of the GNU General Public License along<br/>// with this library; see the file COPYING. &nbsp;If not, write to the Free<br/>// Software Foundation, 59 Temple Place &#8211; Suite 330, Boston, MA 02111-1307,<br/>// USA.<br/><br/>// As a special exception, you may use this file as part of a free software<br/>// library without restriction. &nbsp;Specifically, if other files instantiate<br/>// templates or use macros or inline functions from this file, or you compile<br/>// this file and link it with other files to produce an executable, this<br/>// file does not by itself cause the resulting executable to be covered by<br/>// the GNU General Public License. &nbsp;This exception does not however<br/>// invalidate any other reasons why the executable file might be covered by<br/>// the GNU General Public License.<br/><br/>/*<br/>&nbsp;*<br/>&nbsp;* Copyright (c) 1994<br/>&nbsp;* Hewlett-Packard Company<br/>&nbsp;*<br/>&nbsp;* Permission to use, copy, modify, distribute and sell this software<br/>&nbsp;* and its documentation for any purpose is hereby granted without fee,<br/>&nbsp;* provided that the above copyright notice appear in all copies and<br/>&nbsp;* that both that copyright notice and this permission notice appear<br/>&nbsp;* in supporting documentation. &nbsp;Hewlett-Packard Company makes no<br/>&nbsp;* representations about the suitability of this software for any<br/>&nbsp;* purpose. &nbsp;It is provided &quot;as is&quot; without express or implied warranty.<br/>&nbsp;*<br/>&nbsp;*<br/>&nbsp;* Copyright (c) 1996<br/>&nbsp;* Silicon Graphics Computer Systems, Inc.<br/>&nbsp;*<br/>&nbsp;* Permission to use, copy, modify, distribute and sell this software<br/>&nbsp;* and its documentation for any purpose is hereby granted without fee,<br/>&nbsp;* provided that the above copyright notice appear in all copies and<br/>&nbsp;* that both that copyright notice and this permission notice appear<br/>&nbsp;* in supporting documentation. &nbsp;Silicon Graphics makes no<br/>&nbsp;* representations about the suitability of this &nbsp;software for any<br/>&nbsp;* purpose. &nbsp;It is provided &quot;as is&quot; without express or implied warranty.<br/>&nbsp;*/<br/><br/>/** @file vector.tcc<br/>&nbsp;* &nbsp;This is an internal header file, included by other library headers.<br/>&nbsp;* &nbsp;You should not attempt to use it directly.<br/>&nbsp;*/<br/><br/>#ifndef _VECTOR_TCC<br/>#define _VECTOR_TCC 1<br/><br/>namespace _GLIBCXX_STD<br/>{<br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt;<br/>&nbsp;&nbsp; &nbsp;void<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;reserve(size_type __n)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (__n &gt; this-&gt;max_size())<br/>&nbsp;&nbsp;&nbsp; __throw_length_error(__N(&quot;vector::reserve&quot;));<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (this-&gt;capacity() &lt; __n)<br/>&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp; &nbsp; const size_type __old_size = size();<br/>&nbsp;&nbsp;&nbsp; &nbsp; pointer __tmp = _M_allocate_and_copy(__n,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_start,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp;&nbsp; &nbsp; std::_Destroy(this-&gt;_M_impl._M_start, this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp;&nbsp; &nbsp; _M_deallocate(this-&gt;_M_impl._M_start,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this-&gt;_M_impl._M_end_of_storage &#8211; this-&gt;_M_impl._M_start);<br/>&nbsp;&nbsp;&nbsp; &nbsp; this-&gt;_M_impl._M_start = __tmp;<br/>&nbsp;&nbsp;&nbsp; &nbsp; this-&gt;_M_impl._M_finish = __tmp + __old_size;<br/>&nbsp;&nbsp;&nbsp; &nbsp; this-&gt;_M_impl._M_end_of_storage = this-&gt;_M_impl._M_start + __n;<br/>&nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt;<br/>&nbsp;&nbsp; &nbsp;typename vector&lt;_Tp,_Alloc&gt;::iterator<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;insert(iterator __position, const value_type&amp; __x)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;size_type __n = __position &#8211; begin();<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (this-&gt;_M_impl._M_finish != this-&gt;_M_impl._M_end_of_storage &amp;&amp; __position == end())<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::_Construct(this-&gt;_M_impl._M_finish, __x);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;++this-&gt;_M_impl._M_finish;<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_M_insert_aux(__position, __x);<br/>&nbsp;&nbsp; &nbsp; &nbsp;return begin() + __n;<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt;<br/>&nbsp;&nbsp; &nbsp;typename vector&lt;_Tp,_Alloc&gt;::iterator<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;erase(iterator __position)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (__position + 1 != end())<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::copy(__position + 1, end(), __position);<br/>&nbsp;&nbsp; &nbsp; &nbsp;&#8211;this-&gt;_M_impl._M_finish;<br/>&nbsp;&nbsp; &nbsp; &nbsp;std::_Destroy(this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp;return __position;<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt;<br/>&nbsp;&nbsp; &nbsp;typename vector&lt;_Tp,_Alloc&gt;::iterator<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;erase(iterator __first, iterator __last)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;iterator __i(copy(__last, end(), __first));<br/>&nbsp;&nbsp; &nbsp; &nbsp;std::_Destroy(__i, end());<br/>&nbsp;&nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish = this-&gt;_M_impl._M_finish &#8211; (__last &#8211; __first);<br/>&nbsp;&nbsp; &nbsp; &nbsp;return __first;<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt;<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;&amp;<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;operator=(const vector&lt;_Tp,_Alloc&gt;&amp; __x)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (&amp;__x != this)<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;const size_type __xlen = __x.size();<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (__xlen &gt; capacity())<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(), __x.end());<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::_Destroy(this-&gt;_M_impl._M_start, this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_M_deallocate(this-&gt;_M_impl._M_start,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this-&gt;_M_impl._M_end_of_storage &#8211; this-&gt;_M_impl._M_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_start = __tmp;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_end_of_storage = this-&gt;_M_impl._M_start + __xlen;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else if (size() &gt;= __xlen)<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iterator __i(copy(__x.begin(), __x.end(), begin()));<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::_Destroy(__i, end());<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::copy(__x.begin(), __x.begin() + size(), this-&gt;_M_impl._M_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::uninitialized_copy(__x.begin() + size(), __x.end(), this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish = this-&gt;_M_impl._M_start + __xlen;<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp;return *this;<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt;<br/>&nbsp;&nbsp; &nbsp;void<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;_M_fill_assign(size_t __n, const value_type&amp; __val)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (__n &gt; capacity())<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;vector __tmp(__n, __val, get_allocator());<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;__tmp.swap(*this);<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp;else if (__n &gt; size())<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::fill(begin(), end(), __val);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish<br/>&nbsp;&nbsp;&nbsp; &nbsp; = std::uninitialized_fill_n(this-&gt;_M_impl._M_finish, __n &#8211; size(), __val);<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;erase(fill_n(begin(), __n, __val), end());<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt; template&lt;typename _InputIterator&gt;<br/>&nbsp;&nbsp; &nbsp;void<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;_M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;iterator __cur(begin());<br/>&nbsp;&nbsp; &nbsp; &nbsp;for ( ; __first != __last &amp;&amp; __cur != end(); ++__cur, ++__first)<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;*__cur = *__first;<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (__first == __last)<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;erase(__cur, end());<br/>&nbsp;&nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;insert(end(), __first, __last);<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt; template&lt;typename _ForwardIterator&gt;<br/>&nbsp;&nbsp; &nbsp;void<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;_M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;forward_iterator_tag)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;size_type __len = std::distance(__first, __last);<br/><br/>&nbsp;&nbsp; &nbsp; &nbsp;if (__len &gt; capacity())<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;pointer __tmp(_M_allocate_and_copy(__len, __first, __last));<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::_Destroy(this-&gt;_M_impl._M_start, this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_M_deallocate(this-&gt;_M_impl._M_start,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; this-&gt;_M_impl._M_end_of_storage &#8211; this-&gt;_M_impl._M_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_start = __tmp;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_end_of_storage = this-&gt;_M_impl._M_finish = this-&gt;_M_impl._M_start + __len;<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp;else if (size() &gt;= __len)<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;iterator __new_finish(copy(__first, __last, this-&gt;_M_impl._M_start));<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::_Destroy(__new_finish, end());<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish = __new_finish.base();<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_ForwardIterator __mid = __first;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::advance(__mid, size());<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::copy(__first, __mid, this-&gt;_M_impl._M_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish = std::uninitialized_copy(__mid, __last, this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt;<br/>&nbsp;&nbsp; &nbsp;void<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;_M_insert_aux(iterator __position, const _Tp&amp; __x)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (this-&gt;_M_impl._M_finish != this-&gt;_M_impl._M_end_of_storage)<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::_Construct(this-&gt;_M_impl._M_finish, *(this-&gt;_M_impl._M_finish &#8211; 1));<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;++this-&gt;_M_impl._M_finish;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_Tp __x_copy = __x;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::copy_backward(__position,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;iterator(this-&gt;_M_impl._M_finish-2),<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;iterator(this-&gt;_M_impl._M_finish-1));<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;*__position = __x_copy;<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;const size_type __old_size = size();<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;const size_type __len = __old_size != 0 ? 2 * __old_size : 1;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;iterator __new_start(this-&gt;_M_allocate(__len));<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;iterator __new_finish(__new_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;try<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__new_finish = std::uninitialized_copy(iterator(this-&gt;_M_impl._M_start),<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;__position,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;__new_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::_Construct(__new_finish.base(), __x);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;++__new_finish;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__new_finish = std::uninitialized_copy(__position,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;iterator(this-&gt;_M_impl._M_finish),<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;__new_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;catch(&#8230;)<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::_Destroy(__new_start,__new_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_M_deallocate(__new_start.base(),__len);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__throw_exception_again;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::_Destroy(begin(), end());<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_M_deallocate(this-&gt;_M_impl._M_start,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; this-&gt;_M_impl._M_end_of_storage &#8211; this-&gt;_M_impl._M_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_start = __new_start.base();<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish = __new_finish.base();<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_end_of_storage = __new_start.base() + __len;<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt;<br/>&nbsp;&nbsp; &nbsp;void<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;_M_fill_insert(iterator __position, size_type __n, const value_type&amp; __x)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (__n != 0)<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (size_type(this-&gt;_M_impl._M_end_of_storage &#8211; this-&gt;_M_impl._M_finish) &gt;= __n)<br/>&nbsp;&nbsp;&nbsp; &nbsp; {<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value_type __x_copy = __x;<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;const size_type __elems_after = end() &#8211; __position;<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;iterator __old_finish(this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;if (__elems_after &gt; __n)<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::uninitialized_copy(this-&gt;_M_impl._M_finish &#8211; __n,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish += __n;<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::copy_backward(__position, __old_finish &#8211; __n, __old_finish);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::fill(__position, __position + __n, __x_copy);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::uninitialized_fill_n(this-&gt;_M_impl._M_finish,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;__n &#8211; __elems_after,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;__x_copy);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish += __n &#8211; __elems_after;<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::uninitialized_copy(__position, __old_finish, this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish += __elems_after;<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::fill(__position, __old_finish, __x_copy);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp;&nbsp; &nbsp; }<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp;&nbsp; &nbsp; {<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; const size_type __old_size = size();<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; const size_type __len = __old_size + std::max(__old_size, __n);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; iterator __new_start(this-&gt;_M_allocate(__len));<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; iterator __new_finish(__new_start);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; try<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; {<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; __new_finish = std::uninitialized_copy(begin(), __position,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__new_start);<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; __new_finish = std::uninitialized_fill_n(__new_finish, __n, __x);<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; __new_finish = std::uninitialized_copy(__position, end(),<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__new_finish);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; catch(&#8230;)<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; {<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std::_Destroy(__new_start,__new_finish);<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _M_deallocate(__new_start.base(),__len);<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; __throw_exception_again;<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; std::_Destroy(this-&gt;_M_impl._M_start, this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; _M_deallocate(this-&gt;_M_impl._M_start,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; this-&gt;_M_impl._M_end_of_storage &#8211; this-&gt;_M_impl._M_start);<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; this-&gt;_M_impl._M_start = __new_start.base();<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; this-&gt;_M_impl._M_finish = __new_finish.base();<br/>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; this-&gt;_M_impl._M_end_of_storage = __new_start.base() + __len;<br/>&nbsp;&nbsp;&nbsp; &nbsp; }<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt; template&lt;typename _InputIterator&gt;<br/>&nbsp;&nbsp; &nbsp;void<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;_M_range_insert(iterator __pos,<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_InputIterator __first, _InputIterator __last,<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;input_iterator_tag)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;for ( ; __first != __last; ++__first)<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;__pos = insert(__pos, *__first);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;++__pos;<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp;}<br/><br/>&nbsp;&nbsp;template&lt;typename _Tp, typename _Alloc&gt; template&lt;typename _ForwardIterator&gt;<br/>&nbsp;&nbsp; &nbsp;void<br/>&nbsp;&nbsp; &nbsp;vector&lt;_Tp,_Alloc&gt;::<br/>&nbsp;&nbsp; &nbsp;_M_range_insert(iterator __position,_ForwardIterator __first,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; _ForwardIterator __last, forward_iterator_tag)<br/>&nbsp;&nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp;if (__first != __last)<br/>&nbsp;&nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;size_type __n = std::distance(__first, __last);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (size_type(this-&gt;_M_impl._M_end_of_storage &#8211; this-&gt;_M_impl._M_finish) &gt;= __n)<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;const size_type __elems_after = end() &#8211; __position;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iterator __old_finish(this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (__elems_after &gt; __n)<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::uninitialized_copy(this-&gt;_M_impl._M_finish &#8211; __n,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; this-&gt;_M_impl._M_finish,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish += __n;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::copy_backward(__position, __old_finish &#8211; __n, __old_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::copy(__first, __last, __position);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_ForwardIterator __mid = __first;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::advance(__mid, __elems_after);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::uninitialized_copy(__mid, __last, this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish += __n &#8211; __elems_after;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::uninitialized_copy(__position, __old_finish, this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish += __elems_after;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::copy(__first, __mid, __position);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;const size_type __old_size = size();<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;const size_type __len = __old_size + std::max(__old_size, __n);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iterator __new_start(this-&gt;_M_allocate(__len));<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iterator __new_finish(__new_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__new_finish = std::uninitialized_copy(iterator(this-&gt;_M_impl._M_start),<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;__position, __new_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__new_finish = std::uninitialized_copy(__first, __last,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;__new_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__new_finish = std::uninitialized_copy(__position,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;iterator(this-&gt;_M_impl._M_finish),<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;__new_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch(&#8230;)<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::_Destroy(__new_start,__new_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_M_deallocate(__new_start.base(), __len);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__throw_exception_again;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::_Destroy(this-&gt;_M_impl._M_start, this-&gt;_M_impl._M_finish);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_M_deallocate(this-&gt;_M_impl._M_start,<br/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this-&gt;_M_impl._M_end_of_storage &#8211; this-&gt;_M_impl._M_start);<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_start = __new_start.base();<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_finish = __new_finish.base();<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this-&gt;_M_impl._M_end_of_storage = __new_start.base() + __len;<br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp; &nbsp;}<br/>&nbsp;&nbsp; &nbsp;}<br/>} // namespace std<br/><br/>#endif /* _VECTOR_TCC */<br/><br/>
</div>
<p><script language="javascript" >CodeHilight(document.getElementById("cdh_cpp1"),"CPP");</script><br />
<br/><br />
<br/></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="c" style="font-family:Courier new,verdana;"><span style="color: #993333;">int</span> a<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>↑该死的syntaxhighlighter，还得留个它的小尾巴（因为目前codehilight的css依附于它的css中。。）<br />
(boluor注：现在不需要了，我已经将syntaxhighlighter给禁掉了。在本篇文章中调用了css。)<br />
<br/><br />
<br/><br />
yeah，看来效果还不错。可惜因为还没做成插件，因此使用麻烦些，boluor先将就一下，之后可以将其做成wp插件。<br />
<br/><br />
ok，Sandy收工，boluor，该你上场了～～！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.boluor.com/temptesting-codehilight.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>html页面离开时提示</title>
		<link>http://www.boluor.com/html-prompt-when-page-leave.html</link>
		<comments>http://www.boluor.com/html-prompt-when-page-leave.html#comments</comments>
		<pubDate>Mon, 27 Jul 2009 16:10:40 +0000</pubDate>
		<dc:creator>boluor</dc:creator>
				<category><![CDATA[程序设计]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.boluor.com/?p=210</guid>
		<description><![CDATA[<p>    早上用WEBQQ时，离开页面时它提示说：“你确定要离开吗？”好奇这个怎么做出来的。查了些资料，到现在竟然花了一天的时间。<br />
    在IE下实现很简单，因为有个window.event全局变量。在onbeforeunload事件中调用函数，对window.event.returnValue赋值，即可实现。其returnValue有默认值是不可以改变的。</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:Courier new,verdana;"><span style="color: #009900;">&#60;<span style="color: #000000; font-weight: bold;">html</span>&#62;</span>
<span style="color: #009900;">&#60;<span style="color: #000000; font-weight: bold;">head</span>&#62;</span>
<span style="color: #009900;">&#60;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&#34;javascript&#34;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&#34;text/javascript&#34;</span>&#62;</span>
&#160;
function closePrompt(ev</pre></div></div><p>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>    早上用WEBQQ时，离开页面时它提示说：“你确定要离开吗？”好奇这个怎么做出来的。查了些资料，到现在竟然花了一天的时间。<br />
    在IE下实现很简单，因为有个window.event全局变量。在onbeforeunload事件中调用函数，对window.event.returnValue赋值，即可实现。其returnValue有默认值是不可以改变的。</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:Courier new,verdana;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
&nbsp;
function closePrompt(event1)
{
        window.event.returnValue = &quot;navigation leave test&quot;;
}
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> onbeforeunload<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;closePrompt(event)&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.boluor.com&quot;</span>&gt;</span>Click here to navigate to
www.boluor.com<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p><span id="more-210"></span><br />
    但是上述代码在Firefox下却没有出现提示。查了下才知道，firefox并没有window.event这个全局变量。FF在事件触发的时候才会创建event对象。所以上面的closePrompt函数需要修改传参数并且修改为：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:Courier new,verdana;"><span style="color: #003366; font-weight: bold;">function</span> closePrompt<span style="color: #009900;">&#40;</span>event1<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	event1 <span style="color: #339933;">=</span>event1 <span style="color: #339933;">||</span> window.<span style="color: #660066;">event</span><span style="color: #339933;">;</span>    <span style="color: #006600; font-style: italic;">//FF下window.event为空，IE下不传参数所以event1为空。</span>
	event1.<span style="color: #660066;">returnValue</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;navigation leave test&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>    这种写法在小程序中没什么，但是如果在一个大程序中，很多事件都需要获得event对象，那这种传来传去的写法就不好了。<br />
    然后去搜索webqq页面源代码，竟然没搜到onbeforeunload和onunload关键字。只好一个个的去把js代码下下来，搜索webqq离开时提示的那句话。终于在main.js中找到了，但是这个又调用了util.js，里面有WEBQQ namespace。。。看不下去了。不过搜到了一款很好的js代码格式化工具Javascript Code Improver ，不用像我第一次研究baidu首页代码时一行一行地对齐了。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.boluor.com/html-prompt-when-page-leave.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>textContent与innerText的不同</title>
		<link>http://www.boluor.com/differences-between-textcontent-and-einnertext.html</link>
		<comments>http://www.boluor.com/differences-between-textcontent-and-einnertext.html#comments</comments>
		<pubDate>Sat, 20 Jun 2009 16:20:04 +0000</pubDate>
		<dc:creator>Sandy</dc:creator>
				<category><![CDATA[程序设计]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.boluor.com/?p=138</guid>
		<description><![CDATA[<p><strong>textContent与innerText的不同</strong></p>
<p><strong>by  Sandy_zc_1  :</strong>因为发现网络上很少有这方面的内容，因此就把自己私有blog上的这篇文章搬出来到Boluor的公开blog，方便其它人查阅。</p>
<p><strong>————————————————————————————————————————</strong></p>
<p>以下是正文<strong> </strong>↓↓↓<strong> </strong></p>
<p><strong>textContent与innerText的不同</strong></p>
<p>IE下有个innerText属性，FF下有个textContent属性。很多以前给IE写脚本的，在FF下找不到innerText属性，于是网上搜到的建议是用textContent来替代。反之给FF写脚本的也一样。</p>
<p>但是实际上，这里有个误解。网上很多文章说“F&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><strong>textContent与innerText的不同</strong></p>
<p><strong>by  Sandy_zc_1  :</strong>因为发现网络上很少有这方面的内容，因此就把自己私有blog上的这篇文章搬出来到Boluor的公开blog，方便其它人查阅。</p>
<p><strong>————————————————————————————————————————</strong></p>
<p>以下是正文<strong> </strong>↓↓↓<strong> </strong></p>
<p><strong>textContent与innerText的不同</strong></p>
<p>IE下有个innerText属性，FF下有个textContent属性。很多以前给IE写脚本的，在FF下找不到innerText属性，于是网上搜到的建议是用textContent来替代。反之给FF写脚本的也一样。</p>
<p>但是实际上，这里有个误解。网上很多文章说“FF下等效于innerText属性的属性是textContent”————但是事实上并非如此。innerText与textContent有几点很重要的不同，导致它们在一些情况下不能直接互换使用。</p>
<p>前些日子写了个代码高亮JS插件，在IE下工作完全正常，而在FF下就不对头。在IE下使用的是innerText属性，而在FF下使用的则是textContent属性。在进行字符串处理的时候二者的不同导致了完全不一样的结果。于是就专门写了点东西来测试二者的不同。</p>
<p>根据测试的结果表明：<br />
<strong>innerText：</strong>它的内容实际上就是你在浏览器看到的内容。它的值是经过浏览器解释过的结果：它将元素的innerHTML换码、解释，最终显示出来，然后去除各种格式信息留下的纯文本。它会把&lt;br/&gt;换成换行符，会将多个空格并成一个空格对待，而本来的换行符却并不会引起换行，IE会将其当作一个普通的单词边界（一般是空格）。再说的形象点，一个元素的innerText属性的值，和你将这个元素内容复制粘贴到记事本里的内容一致。<span id="more-138"></span></p>
<p><strong>textContent：</strong>它的内容则是innerHTML去除所有标签后的内容（我怀疑这个是从XMLDOM中照搬过来的属性，特性完全一致）。它会将innerHTML中的转义字符（&amp;lt;、&amp;nbsp;什么的）进行换码，但是不对任何html标签进行解释，而是直接剔除它们。它也不会对innerHTML中的文本按照HTML的方式进行格式转换，比如多个空格还会原原本本地保留，不会合并为一个空格，换行符仍然存在（相反&lt;br/&gt;却不会导致换行）。</p>
<p><span style="color: navy;">更加简练的总结：IE中的innerText是需要对innerHTML的值进行：<br />
1、HTML转义（等同于XML转义，对&amp;lt;、&amp;amp;等转义字符进行处理）；<br />
2、经过HTML解释和CSS样式解释；<br />
3、之后又剔除格式信息<br />
之后留下的纯文本。<br />
而FF中的textContent没有2、3步，在经过了HTML转义之后直接剔除所有html标签后得到的纯文本。</span></p>
<p>一个例子：</p>
<blockquote><p>&lt;div id=”T1&#8243;&gt;<br />
ABCD<br />
EFG   HIJ&lt;br/&gt;KLM &amp;nbsp;N<br />
OPQ&lt;div&gt;RS&lt;/div&gt;T<br />
T<br />
&lt;div&gt;</p></blockquote>
<p>这个id为T1的div，<br />
在<span style="color: blue;">IE中的innerText属性</span>的值为：</p>
<blockquote><p>ABCD EFG HIJ<br />
KLM  N OPQ<br />
RS<br />
T T</p></blockquote>
<p>而<span style="color: blue;">在FF中的textContent的属性</span>的值为：</p>
<blockquote>
<div><span style="color: teal;"><em>(这里有个换行)</em></span><br />
ABCD<br />
EFG   HIJKLM  N<br />
OPQRST<br />
T</div>
</blockquote>
<div>注意那个div中还嵌套了个div，而这个更能反映IE的innerText和FF的textContent各自的处理方式的不同：<br />
div是块（block）元素，默认会独占一行，因此，在IE中的innerText反映为上述div中的RS独占一行，而FF的textContent完全不理会HTML格式，因此其textContent中的RS是和其它字符连在一起的，不会独占一行。</p>
<p>.</p>
<p>如果想更进一步，看看这个有趣的结果：<br />
假如给里面那个div加一个style=”float:left;”，那么这个div就会由块元素变化为行元素，不再独占一行，因此IE的innerText属性中RS便不再独占一行，而与其它字符连在一起，而在FF中由于textContent不理会标签更不会理会CSS，因此它的textContent属性的值不会有任何变化。</p>
<p>.</p>
<p>这么看来，很多网上说的“让FF支持innerText属性”云云，其实都是多多少少有问题的。要实现IE的innerText，远没有想象中的那么简单，你若要使用JavaScript让FF拥有和innerText完全一样的效果，得自己把html标签属性全部parse一遍，解释它们，甚至还需要去解释css……<br />
（不过根据原理，貌似通过剪贴板的复制和取回操作可以在FF下模拟innerText效果（这个未测试），但是1有副作用，2FF下的剪贴板操作也很麻烦。）</p>
<p>不过还好，大多数时候我们并不需要那么精确，使用innerHTML做点简单的处理即可达到比较接近的效果了。</p></div>
<p><em>注：以上代码均在IE6和FF3下完成测试。</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.boluor.com/differences-between-textcontent-and-einnertext.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

