diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/EULA.rtf b/windows_libs/Microsoft Visual C++ Toolkit 2003/EULA.rtf
new file mode 100644
index 00000000..46c764b4
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/EULA.rtf
@@ -0,0 +1,237 @@
+{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
+{\f35\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f36\froman\fcharset0\fprq2{\*\panose 02040602050305030304}Book Antiqua;}{\f37\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Microsoft Logo;}
+{\f38\fswiss\fcharset0\fprq2{\*\panose 020b0706030402020204}Franklin Gothic Demi Cond;}{\f39\fswiss\fcharset0\fprq2{\*\panose 020b0503020102020204}Franklin Gothic Book{\*\falt Franklin Gothic Medium};}{\f64\froman\fcharset238\fprq2 Times New Roman CE;}
+{\f65\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f67\froman\fcharset161\fprq2 Times New Roman Greek;}{\f68\froman\fcharset162\fprq2 Times New Roman Tur;}{\f69\froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\f70\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f71\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f72\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f74\fswiss\fcharset238\fprq2 Arial CE;}
+{\f75\fswiss\fcharset204\fprq2 Arial Cyr;}{\f77\fswiss\fcharset161\fprq2 Arial Greek;}{\f78\fswiss\fcharset162\fprq2 Arial Tur;}{\f79\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f80\fswiss\fcharset178\fprq2 Arial (Arabic);}
+{\f81\fswiss\fcharset186\fprq2 Arial Baltic;}{\f82\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f414\fswiss\fcharset238\fprq2 Tahoma CE;}{\f415\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f417\fswiss\fcharset161\fprq2 Tahoma Greek;}
+{\f418\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f419\fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f420\fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f421\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f422\fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
+{\f423\fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f424\froman\fcharset238\fprq2 Book Antiqua CE;}{\f425\froman\fcharset204\fprq2 Book Antiqua Cyr;}{\f427\froman\fcharset161\fprq2 Book Antiqua Greek;}{\f428\froman\fcharset162\fprq2 Book Antiqua Tur;}
+{\f431\froman\fcharset186\fprq2 Book Antiqua Baltic;}{\f444\fswiss\fcharset238\fprq2 Franklin Gothic Demi Cond CE;}{\f445\fswiss\fcharset204\fprq2 Franklin Gothic Demi Cond Cyr;}{\f447\fswiss\fcharset161\fprq2 Franklin Gothic Demi Cond Greek;}
+{\f448\fswiss\fcharset162\fprq2 Franklin Gothic Demi Cond Tur;}{\f451\fswiss\fcharset186\fprq2 Franklin Gothic Demi Cond Baltic;}{\f454\fswiss\fcharset238\fprq2 Franklin Gothic Book CE{\*\falt Franklin Gothic Medium};}
+{\f455\fswiss\fcharset204\fprq2 Franklin Gothic Book Cyr{\*\falt Franklin Gothic Medium};}{\f457\fswiss\fcharset161\fprq2 Franklin Gothic Book Greek{\*\falt Franklin Gothic Medium};}
+{\f458\fswiss\fcharset162\fprq2 Franklin Gothic Book Tur{\*\falt Franklin Gothic Medium};}{\f461\fswiss\fcharset186\fprq2 Franklin Gothic Book Baltic{\*\falt Franklin Gothic Medium};}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
+\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
+\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive
+\ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
+\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\s15\ql \fi-274\li274\ri0\sb120\sl-460\slmult0
+\nowidctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin274\itap0 \f38\fs44\lang1033\langfe1033\kerning42\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext15 1. Section Head;}{\s16\ql \li0\ri0\sb120\sl-200\slmult0\widctlpar\brdrt\brdrs\brdrw15
+\tx576\tx1152\tx1728\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \caps\f38\fs16\lang1033\langfe1033\kerning16\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext16 4. LA Para Head;}{\s17\ql \li0\ri-18\sb120\sl-240\slmult0\widctlpar
+\tx576\tx1152\tx1728\aspalpha\aspnum\faauto\adjustright\rin-18\lin0\itap0 \f38\fs22\lang1033\langfe1033\kerning22\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 2. LA Subhead;}{\s18\ql \li0\ri0\sb60\sl-180\slmult0
+\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext18 3. LA Body;}{\s19\ql \fi-187\li187\ri0\sb60\sl-180\slmult0
+\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin187\itap0 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon18 \snext19 3c. Numbered;}{\s20\ql \fi-340\li624\ri0\sb60\sl-160\slmult0
+\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin624\itap0 \f39\fs14\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon18 \snext20 3i. Numbered 2nd level;}{\s21\ql \fi-510\li1134\ri0\sb40\sl-180\slmult0
+\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin1134\itap0 \f39\fs16\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon18 \snext21 3k. Numbered-Sub 3rd level;}{\s22\ql \fi-567\li1701\ri0\sb40\sl-180\slmult0
+\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin1701\itap0 \f39\fs16\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon21 \snext22 3m. Numbered 4th level;}{\s23\ql \li0\ri0\sb240\sl-240\slmult0\widctlpar
+\tx576\tx1152\tx1728\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f38\fs22\lang1033\langfe1033\kerning22\cgrid\langnp1033\langfenp1033 \sbasedon17 \snext23 2a. French Subhead;}{\s24\ql \li0\ri0\sl-180\slmult0\widctlpar
+\tqc\tx4320\tqr\tx8640\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 footer;}{\s25\ql \li0\ri0\sl-320\slmult0\widctlpar
+\tx360\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs12\cf5\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext25 6. Part No.;}{\*\cs26 \additive \sbasedon10 page number;}{\*\cs27 \additive \fs16 \sbasedon10 \ssemihidden
+annotation reference;}{\s28\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext28 \ssemihidden annotation text;}{\s29\ql \li0\ri0\widctlpar
+\tqc\tx4320\tqr\tx8640\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext29 header;}{\s30\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f35\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext30 \ssemihidden Balloon Text;}{\*\cs31 \additive \ul\cf2 \sbasedon10 Hyperlink;}{\s32\ql \fi-274\li274\ri0\sb120\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin274\itap0
+\f36\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext32 \slink33 Body 1;}{\*\cs33 \additive \f36\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \slink32 Body 1 Char;}}{\*\rsidtbl \rsid14224422}
+{\*\generator Microsoft Word 10.0.4524;}{\info{\title END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE}{\creatim\yr2004\mo4\dy7\hr8\min43}{\revtim\yr2004\mo4\dy7\hr8\min43}{\printim\yr2004\mo3\dy17\hr12\min30}{\version2}{\edmins1}{\nofpages6}
+{\nofwords2790}{\nofchars15906}{\nofcharsws18659}{\vern16475}}\margl1440\margr1440 \widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace100\dgvspace136\dghorigin1440\dgvorigin1440\dghshow2
+\dgvshow2\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\rempersonalinfo\rsidroot14224422 \fet0{\*\ftnsep \pard\plain
+\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid14224422 \chftnsep
+\par }}{\*\ftnsepc \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid14224422 \chftnsepc
+\par }}{\*\aftnsep \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid14224422 \chftnsep
+\par }}{\*\aftnsepc \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid14224422 \chftnsepc
+\par }}\sectd \psz1\sbknone\linex0\headery0\sectdefaultcl\sftnbj {\header \pard\plain \s29\ql \li0\ri0\widctlpar\tqc\tx4320\tqr\tx8640\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid14224422
+
+\par }}{\footer \pard\plain \s24\ql \li0\ri0\sl-180\slmult0\widctlpar\tqc\tx4320\tqr\tx8640\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid14224422
+\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}
+{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8
+\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \s15\ql \li0\ri0\sa60\nowidctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f38\fs44\lang1033\langfe1033\kerning42\cgrid\langnp1033\langfenp1033 {\b\f36\fs28\insrsid14224422\charrsid9510088 END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE
+\par }{\b\f36\fs22\insrsid14224422
+\par }{\b\f36\fs24\insrsid14224422 MICROSOFT VISUAL C++ TOOLKIT 2003
+\par }{\b\f36\fs22\kerning44\insrsid14224422
+\par }\pard\plain \s17\ql \li0\ri-17\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin-17\lin0\itap0 \f38\fs22\lang1033\langfe1033\kerning22\cgrid\langnp1033\langfenp1033 {\b\f36\insrsid14224422 IMPORTANT\emdash READ CAREFULLY: }{\f36\insrsid14224422
+This End-User License Agreement (\'93EULA\'94) is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation (\'93Microsoft\'94
+) for the Microsoft software that accompanies this EULA, which includes computer software and may include associated media, printed materials including best practices, white papers, templates, \'93online\'94 or electronic documentation, and Internet-ba
+sed services (\'93Software\'94). An amendment or addendum to this EULA may accompany the Software. }{\b\f36\insrsid14224422
+YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE. IF YOU DO NOT AGREE, DO NOT INSTALL, COPY, OR USE THE SOFTWARE.
+\par
+\par
+\par }\pard\plain \s16\ql \li0\ri0\sa60\widctlpar\brdrt\brdrs\brdrw15 \aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \caps\f38\fs16\lang1033\langfe1033\kerning16\cgrid\langnp1033\langfenp1033 {\b\f36\fs22\insrsid14224422
+\par MICROSOFT Software LICENSE
+\par }\pard\plain \ql \li0\ri0\sa144\widctlpar\faauto\rin0\lin0\itap0\lisa60 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 1.\tab }{\b\f36\fs22\insrsid14224422 GRANTS OF LICENSE}{\f36\fs22\insrsid14224422
+. Microsoft grants you the rights described in this EULA provided that you comply with all terms and conditions of this EULA. }{\insrsid14224422
+\par }\pard\plain \s20\ql \fi720\li0\ri0\sa144\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\lisa60 \f39\fs14\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422\charrsid3747970 1.1\tab }{
+\b\i\f36\fs22\insrsid14224422\charrsid3747970 General License Grant}{\f36\fs22\insrsid14224422\charrsid3747970 . Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the Software }{\f36\fs22\insrsid14224422
+(i) }{\f36\fs22\insrsid14224422\charrsid3747970 for your internal use}{\f36\fs22\insrsid14224422 ; (ii) for designing, developing, testing and demonstrating your software product(s); }{\f36\fs22\insrsid14224422\charrsid3747970 and }{
+\f36\fs22\insrsid14224422 (iii) for }{\f36\fs22\insrsid14224422\charrsid3747970 evaluation}{\f36\fs22\insrsid14224422 of the Software}{\f36\fs22\insrsid14224422\charrsid3747970 .}{\f36\fs22\insrsid14224422
+\par }\pard \s20\ql \fi720\li0\ri0\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\f36\fs22\insrsid14224422 1.2\tab }{\b\i\f36\fs22\insrsid14224422 Documentation}{\f36\fs22\insrsid14224422 .}{\b\f36\fs22\insrsid14224422 }{
+\f36\fs22\insrsid14224422 You may }{\f36\fs22\insrsid14224422 ma
+ke and use an unlimited number of copies of any documentation, provided that such copies shall be used only for personal internal purposes and are not to be republished or distributed (either in hard copy or electronic form) beyond your premises }{
+\f36\fs22\insrsid14224422\charrsid10697201 except as otherwise specifically provided herein.}{\f36\fs22\insrsid14224422
+\par }\pard\plain \s19\ql \li0\ri0\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\f36\fs22\insrsid14224422 2.\tab ADDITIONAL LICENSE RIGHTS -- REDISTRIBUTABLES}{
+\f36\fs22\insrsid14224422 . In addition to the rights granted in Section 1, certain portions of the Software, as described in this Section\~2, are provided to you with additional license rights.
+ These additional license rights are conditioned upon your compliance with the distribution requirements and license restrictions described in Section 3.}{\i\f36\fs22\insrsid14224422
+\par }\pard\plain \s20\ql \fi720\li0\ri0\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs14\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 2.1\tab }{\b\i\f36\fs22\insrsid14224422 Sample Code.}{
+\f36\fs22\insrsid14224422 Microsoft grants you the right to use and modify the source code version of those portions of the Software identified as \'93Samples\'94 in REDIST.TXT or elsewhere in the Software (\'93Sample Code\'94
+) for the sole purposes of designing, developing, and testing your software product(s), and to reproduce and distribute the Sample Code along with any modifications thereof, in }{\f36\fs22\insrsid14224422\charrsid10697201 object and/or source code form}{
+\f36\fs22\insrsid14224422 . For applicable redistribution requirements for Sample Code, see Section\~3.1 below.
+\par 2.2\tab }{\b\i\f36\fs22\insrsid14224422 Redistributable Code\emdash General}{\f36\fs22\insrsid14224422 . Microsoft grants you a nonexclusive, royalty-free right to reproduce and dist
+ribute the object code form of any portion of the Software listed in REDIST.TXT (\'93Redistributable Code\'94). For general redistribution requirements for Redistributable Code, see Section\~3.1, below. }{\insrsid14224422
+\par }{\f36\fs22\insrsid14224422
+\par }{\insrsid14224422
+\par }\pard\plain \s19\ql \li0\ri0\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 3.\tab }{\b\f36\fs22\insrsid14224422
+LICENSE RESTRICTIONS -- DISTRIBUTION REQUIREMENTS.}{\f36\fs22\insrsid14224422 If you choose to exercise your rights under Section\~2, any redistribution by you is subject to your compliance with the following terms.
+\par }\pard\plain \ql \fi720\li0\ri0\sb100\sa100\widctlpar\faauto\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 3.1\tab If you are authorized and choose to redistribute Sample Code }{
+\f36\fs22\insrsid14224422\charrsid10697201 or Redistributable Code (collectively, the \'93Redistributables\'94) as described in Section 2, you agr}{\f36\fs22\insrsid14224422 ee: }{\b\f36\fs22\insrsid14224422 (i)}{\f36\fs22\insrsid14224422
+ except as otherwise noted in Section 2.1 (Sample Code) }{\f36\fs22\insrsid14224422\charrsid10697201 to distribute the Redistributables only }{\f36\fs22\insrsid14224422
+in object code form and in conjunction with and as a part of a software application product developed by you that adds significant and primary functionality to the Redistributables (\'93Licensee Software\'94); }{\b\f36\fs22\insrsid14224422 (ii)}{
+\f36\fs22\insrsid14224422 \~that the Redistributables only operate in conjunction with Microsoft Windows platforms; }{\b\f36\fs22\insrsid14224422 (iii)}{\f36\fs22\insrsid14224422 }{\f36\fs22\insrsid14224422\charrsid8725318 to}{
+\b\f36\fs22\insrsid14224422\charrsid8725318 }{\f36\fs22\insrsid14224422 distribute the Licensee}{\f36\fs22\insrsid14224422\charrsid8725318 }{\f36\fs22\insrsid14224422 Software}{\f36\fs22\insrsid14224422\charrsid8725318 containing the Redistrib
+utables pursuant to an end user license agreement (which may be \'93break-the-seal\'94, \'93click-wrap\'94 or signed), with terms no less protective than those contained }{\f36\fs22\insrsid14224422 in this EULA}{\f36\fs20\insrsid14224422\charrsid13910098
+;}{\f36\fs20\insrsid14224422 (}{\b\f36\fs20\insrsid14224422\charrsid8725318 iv}{\f36\fs20\insrsid14224422 )\~}{\f36\fs22\insrsid14224422 not to use Microsoft\rquote s name, logo, or trademarks to market the Licensee Software; }{
+\b\f36\fs22\insrsid14224422 (v)}{\f36\fs22\insrsid14224422 }{\f36\fs22\insrsid14224422 to display your }{\f36\fs22\insrsid14224422\charrsid8725318 own valid }{\f36\fs22\insrsid14224422 copyright notice }{\f36\fs22\insrsid14224422\charrsid8725318
+which shall be}{\f36\fs22\cf6\insrsid14224422 }{\f36\fs22\insrsid14224422 sufficient to protect Microsoft\rquote s copyright in the Software; }{\b\f36\fs22\insrsid14224422 (vi)}{\f36\fs22\insrsid14224422 \~
+not to remove or obscure any copyright, trademark or patent notices that appear on the Software as delivered to you; }{\b\f36\fs22\insrsid14224422 (vii)}{\f36\fs22\insrsid14224422 to
+ indemnify, hold harmless, and defend Microsoft from and against any claims or lawsuits, including attorney\rquote s fees, that arise or result from the use or distribution of the Licensee Software; }{\b\f36\fs22\insrsid14224422 (viii)}{
+\f36\fs22\insrsid14224422 otherwise comply with the terms of this EULA; and }{\b\f36\fs22\insrsid14224422 (ix)\~}{\f36\fs22\insrsid14224422 agree that Microsoft reserves all rights not expressly granted. }{
+\b\i\f36\fs22\insrsid14224422\charrsid16543122
+\par }\pard \ql \fi1440\li0\ri0\sb100\sa100\widctlpar\faauto\rin0\lin0\itap0 {\f36\fs22\insrsid14224422 You also agree not to permit further distribution of the Redistributables by your end users }{\i\f36\fs22\insrsid14224422 except}{\f36\fs22\insrsid14224422
+ you may permit further redistribution of the Redistributables by your distributors to your e
+nd-user customers if your distributors only distribute the Redistributables in conjunction with, and as part of, the Licensee Software and you and your distributors comply with all other terms of this EULA.
+\par }\pard\plain \s32\ql \fi630\li90\ri0\sb120\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin90\itap0 \f36\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\fs22\insrsid14224422 3.2\tab If you use the Redistributables, then in add
+ition to your compliance with the applicable distribution requirements described for the Redistributables, the following also applies}{\fs22\insrsid14224422\charrsid6578484 . Your license rights to the Redistributable}{\fs22\insrsid14224422 s}{
+\fs22\insrsid14224422\charrsid6578484 are conditioned upon your not (a) creating derivative works of the Redistributable}{\fs22\insrsid14224422 s}{\fs22\insrsid14224422\charrsid6578484 in any manner that would cause the Redistributable}{
+\fs22\insrsid14224422 s}{\fs22\insrsid14224422\charrsid6578484 in whole or in part to become subject to any of the terms of an Excluded License; and (b) distributing the Redistributable}{\fs22\insrsid14224422 s}{\fs22\insrsid14224422\charrsid6578484
+ (or derivative works thereof) in any manner that would cause the Redistributable}{\fs22\insrsid14224422 s}{\fs22\insrsid14224422\charrsid6578484 to become subject to any of the terms of an Excluded License. An \'93Excluded License\'94
+ is any license which requires as a condition of use, modification and/or distribution of software subject to the Excluded License, that such software or other
+software combined and/or distributed with such software (x) be disclosed or distributed in source code form; (y) be licensed for the purpose of making derivative works; or (z) be redistributable at no charge}{\b\fs22\cf1\insrsid14224422\charrsid6578484 .}
+{\fs22\cf1\insrsid14224422\charrsid6578484
+\par }\pard\plain \s19\ql \li0\ri0\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 4.\tab }{\b\f36\fs22\insrsid14224422
+RESERVATION OF RIGHTS AND OWNERSHIP. }{\f36\fs22\insrsid14224422 Micros
+oft reserves all rights not expressly granted to you in this EULA. The Software is protected by copyright and other intellectual property laws and treaties. Microsoft or its suppliers own the title, copyright, and other intellectual property rights in th
+e Software. }{\b\f36\fs22\insrsid14224422 The Software is licensed, not sold.}{\f36\fs22\insrsid14224422
+\par }\pard\plain \s20\ql \li0\ri0\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs14\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 5.\tab }{\b\f36\fs22\insrsid14224422
+LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY}{\b\i\f36\fs22\insrsid14224422 .}{\f36\fs22\insrsid14224422
+ You may not reverse engineer, decompile, or disassemble the Software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
+\par }\pard\plain \s19\ql \li0\ri0\sl220\slmult0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 6.}{\f36\fs22\cf6\insrsid14224422 \tab }{
+\b\f36\fs22\insrsid14224422 NO }{\b\f36\fs22\insrsid14224422 RENTAL/COMMERCIAL HOSTING.}{\b\i\f36\fs22\insrsid14224422 }{\f36\fs22\insrsid14224422 You may not rent, lease, lend, or provide commercial hosting services with the Software.
+\par }\pard\plain \s20\ql \li0\ri0\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs14\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 7.\tab }{\b\f36\fs22\insrsid14224422 CONSENT TO USE OF DATA.}{
+\b\f36\fs22\insrsid14224422 }{\f36\fs22\insrsid14224422 You agree that Microsoft and its affiliates may c
+ollect and use technical information gathered as part of the product support services provided to you, if any, related to the Software. Microsoft may use this information solely to improve our products or to provide customized services or technologies to
+ you and will not disclose this information in a form that personally identifies you. }{\f36\fs22\insrsid14224422
+\par }\pard\plain \s19\ql \li0\ri0\sb60\sl220\slmult0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 8.\tab }{\b\f36\fs22\insrsid14224422
+LINKS TO THIRD PARTY SITES. }{\f36\fs22\insrsid14224422 You may link to third party sites through the use of the Software. The third party sites are not under the control of Microsoft, and Mi
+crosoft is not responsible for the contents of any third party sites, any links contained in third party sites, or any changes or updates to third party sites. Microsoft is not responsible for webcasting or any other form of transmission received from an
+y third party sites. Microsoft is providing these links to third party sites to you only as a convenience, and the inclusion of any link does not imply an endorsement by Microsoft of the third party site.
+\par }\pard\plain \s20\ql \li0\ri0\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs14\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 9.\tab }{\b\f36\fs22\insrsid14224422 ADDITIONAL SOFTWARE/SERVICES.
+}{\f36\fs22\insrsid14224422 This EULA applies
+ to updates, supplements, add-on components, or Internet-based services components, of the Software that Microsoft may provide to you or make available to you after the date you obtain your initial copy of the Software, unless we provide other terms along
+ with the update, supplement, add-on component, or Internet-based services component. Microsoft reserves the right to discontinue any Internet-based services provided to you or made available to you through the use of the Software. }{
+\f36\fs22\insrsid14224422
+\par }\pard\plain \s19\ql \li0\ri0\sb120\sl220\slmult0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 10.\tab }{\b\f36\fs22\insrsid14224422 EXPORT RESTRICTIONS
+}{\f36\fs22\insrsid14224422 . }{\f36\fs22\cgrid0\insrsid14224422
+You acknowledge that the Software is subject to U.S. export jurisdiction. You agree to comply with all applicable international and national laws that apply to the Software, including the U.S. Export Administration Regulations, as well as end-user, en
+d-use, and destination restrictions issued by U.S. and other governments. For additional information, see }{\f36\fs22\ul\cgrid0\insrsid14224422 }{\f36\fs22\cgrid0\insrsid14224422 .
+\par }\pard\plain \s20\ql \li0\ri0\sa60\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs14\cf1\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 11.\tab }{\b\f36\fs22\insrsid14224422 SOFTWARE TRANSFER. }{
+\f36\fs22\insrsid14224422 The initial user of the Software may make a one-time permanent transfer of this EULA
+and Software to another end user, provided the initial user retains no copies of the Software. This transfer must include all of the Software (including all component parts, the media and printed materials, any upgrades to this EULA, and, if applicable,
+the Certificate of Authenticity). The transfer may not be an indirect transfer, such as a consignment. Prior to the transfer, the end user receiving the Software must agree to all the EULA terms.
+\par 12.\tab }{\b\f36\fs22\insrsid14224422 TERMINATION.}{\f36\fs22\insrsid14224422 Without prejudice to any other rights, Mi
+crosoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the Software and all of its component parts.
+\par }\pard\plain \s19\ql \li0\ri0\sb60\sl220\slmult0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\insrsid14224422 13.\tab }{\b\f36\fs22\ul\insrsid14224422\charrsid16006145
+DISCLAIMER OF WARRANTIES}{\b\f36\fs22\insrsid14224422 . TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND ITS SUPPLIERS PROVIDE THE }{\b\f36\fs22\insrsid14224422 SOFTWARE}{\f36\fs22\insrsid14224422 }{\b\f36\fs22\insrsid14224422
+AND SUPPORT SERVICES (IF ANY) }{\b\i\f36\fs22\insrsid14224422 AS IS AND WITH ALL FAULTS}{\b\f36\fs22\insrsid14224422 , AND HEREBY DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY (IF
+ANY) IMPLIED WARRANTIES, DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF RELIABILITY OR AVAILABILITY, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGEN
+CE, ALL WITH REGARD TO THE }{\b\f36\fs22\insrsid14224422 SOFTWARE}{\b\f36\fs22\insrsid14224422
+, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT OR OTHER SERVICES, INFORMATION, SOFTWARE, AND RELATED CONTENT THROUGH THE SOFTWARE OR OTHERWISE ARISING OUT OF THE USE OF THE SOFTWARE. ALSO, THERE IS NO WARRANTY OR CO
+NDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE SOFTWARE.
+\par }{\f36\fs22\insrsid14224422 14.}{\b\f36\fs22\insrsid14224422 \tab }{\b\f36\fs22\ul\insrsid14224422\charrsid10224643 EXCLUSION OF INCIDENTAL, CONSEQUENTIAL AND CERTAIN OTHER DAMAGES}{\b\f36\fs22\insrsid14224422 . }{\b\caps\f36\fs22\insrsid14224422
+To the maximum extent permitted by applicable law, in
+ no event shall Microsoft or its suppliers be liable for any special, incidental, punitive, indirect, or consequential damages whatsoever (including, but not limited to, damages for loss of profits or confidential or other information}{
+\b\f36\fs22\insrsid14224422 , }{\b\caps\f36\fs22\insrsid14224422 for business interruption, for personal injury, for loss of privacy, for failure to meet any duty including of good faith or of reasonable care, for negligence, and}{
+\b\f36\fs22\insrsid14224422 }{\b\caps\f36\fs22\insrsid14224422 for any other pecuniary or other loss whatsoever) arising out of or in any way related to the use of or inabili
+ty to use the SOFTWARE, the provision of or failure to provide Support OR OTHER Services, informatIon, software, and related CONTENT through the software or otherwise arising out of the use of the software, or otherwise under or in connection with any pro
+v
+ision of this EULA, even in the event of the fault, tort (including negligence), misrepresentation, strict liability, breach of contract or breach of warranty of Microsoft or any supplier, and even if Microsoft or any supplier has been advised of the poss
+ibility of such damages.
+\par }{\f36\fs22\insrsid14224422 15.}{\b\f36\fs22\insrsid14224422 \tab }{\b\f36\fs22\ul\insrsid14224422\charrsid10224643 LIMITATION OF LIABILITY AND REMEDIES}{\b\f36\fs22\insrsid14224422
+. NOTWITHSTANDING ANY DAMAGES THAT YOU MIGHT INCUR FOR ANY REASON WHATSOEVER (INCLUDING, WITHOUT LIMITATION, ALL DAMAGES REFERENCED HEREIN AND ALL DIRECT OR GENERAL DAMAGES IN CONTRACT OR ANY
+THING ELSE), THE ENTIRE LIABILITY OF MICROSOFT AND ANY OF ITS SUPPLIERS UNDER ANY PROVISION OF THIS EULA AND YOUR EXCLUSIVE REMEDY HEREUNDER SHALL BE LIMITED TO THE GREATER OF THE ACTUAL DAMAGES YOU INCUR IN REASONABLE RELIANCE ON THE SOFTWARE UP TO THE A
+MOUNT ACTUALLY PAID BY YOU FOR THE }{\b\f36\fs22\insrsid14224422 SOFTWARE}{\f36\fs22\insrsid14224422 }{\b\f36\fs22\insrsid14224422
+OR US$5.00. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS ITS ESSENTIAL PURPOSE.
+\par }\pard \s19\ql \li0\ri0\sa96\sl220\slmult0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\lisa40 {\f36\fs22\insrsid14224422\charrsid223825 1}{\f36\fs22\insrsid14224422 6}{\f36\fs22\insrsid14224422\charrsid223825 .\tab }{
+\b\f36\fs22\insrsid14224422\charrsid223825 APPLICABLE LAW. }{\f36\fs22\insrsid14224422\charrsid223825 If you acquire
+d this Software in the United States, this EULA is governed by the laws of the State of Washington. If you acquired this Software in Canada, unless expressly prohibited by local law, this EULA is governed by the laws in force in the Province of Ontario,
+Canada; and, in respect of any dispute which may arise hereunder, you consent to the jurisdiction of the federal and provincial courts sitting in Toronto, Ontario. If you acquired this Software in the Eur}{\f36\fs22\insrsid14224422 o}{
+\f36\fs22\insrsid14224422\charrsid223825 pean Union, Iceland, Norway, or Switzerland, then local law applies. If you acquired this }{\f36\fs22\insrsid14224422 Software in any other country, }{\f36\fs22\insrsid14224422\charrsid223825
+then local law may apply. }{\f36\fs22\insrsid14224422
+\par }\pard \s19\ql \li0\ri0\sb120\sl220\slmult0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\f36\fs22\insrsid14224422 17.\tab }{\b\f36\fs22\insrsid14224422 U.S. GOVERNMENT LICENSE RIGHTS}{\f36\fs22\insrsid14224422
+. All Software provided to the U.S. Government pursuant to solicitations issued on or after December 1, 1995 is provided with
+ the commercial license rights and restrictions described elsewhere herein. All Software provided to the U.S. Government pursuant to solicitations issued prior to December 1, 1995 is provided with \'93Restricted Rights\'94
+ as provided for in FAR, 48 CFR 52.227-14 (JUNE 1987) or DFAR, 48 CFR 252.227-7013 (OCT 1988), as applicable.
+\par }\pard \s19\ql \li0\ri0\sa96\sl220\slmult0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\lisa40 {\f36\fs22\insrsid14224422\charrsid223825 1}{\f36\fs22\insrsid14224422 8}{\f36\fs22\insrsid14224422\charrsid223825 .\tab }{
+\b\f36\fs22\insrsid14224422\charrsid223825 ENTIRE AGREEMENT; SEVERABILITY. }{\f36\fs22\insrsid14224422\charrsid223825
+This EULA (including any addendum or amendment to this EULA which is included with the Software) are the entire agreement between you and Microsoft
+ relating to the Software and the support services (if any) and they supersede all prior or contemporaneous oral or written communications, proposals and representations with respect to the Software or any other subject matter covered by this EULA. To th
+e
+ extent the terms of any Microsoft policies or programs for support services conflict with the terms of this EULA, the terms of this EULA shall control. If any provision of this EULA is held to be void, invalid, unenforceable or illegal, the other provis
+ions shall continue in full force and effect.}{\f36\fs22\insrsid14224422
+\par }\pard\plain \ql \li0\ri0\keep\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f36\fs22\cf1\insrsid14224422
+Should you have any questions concerning this EULA, or if you desire to contact Microsoft for any reason, please use the address information enclosed in this Software to contact the Microsoft subsidiary serving
+your country or visit Microsoft on the World Wide Web at }{\field\flddirty{\*\fldinst {\f36\fs22\cf1\insrsid14224422 HYPERLINK "http://www.microsoft.com" }{\f36\fs22\cf1\insrsid14224422 {\*\datafield
+00d0c9ea79f9bace118c8200aa004ba90b02000000170000001900000068007400740070003a002f002f007700770077002e006d006900630072006f0073006f00660074002e0063006f006d000000e0c9ea79f9bace118c8200aa004ba90b3400000068007400740070003a002f002f007700770077002e006d0069006300
+72006f0073006f00660074002e0063006f006d002f000000}}}{\fldrslt {\f36\fs22\ul\cf2\insrsid14224422 http://www.microsoft.com}}}{\f36\fs22\cf1\insrsid14224422 .
+\par }\pard\plain \s19\ql \li0\ri0\sa96\sl220\slmult0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\lisa40 \f39\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\f36\fs22\insrsid14224422\charrsid223825
+\par }\pard\plain \s23\ql \li0\ri0\sb240\sl-240\slmult0\widctlpar\tx576\tx1152\tx1728\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f38\fs22\lang1033\langfe1033\kerning22\cgrid\langnp1033\langfenp1033 {
+\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 Si vous avez acquis votre produit Microsoft au CANADA, la garantie limit\'e9e suivante }{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 s\rquote applique}{
+\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 \~:
+\par }{\b\f36\ul\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid2979837 D\'c9NI DE GARANTIES}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 . }{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 D}{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 ANS LA MESURE MAXIMALE PERMISE PAR LES LOIS APPLICABLES, LE LOGICIEL ET LES SERVICES DE SOUTIEN TECHNIQUE (LE CAS \'c9CH\'c9ANT) SONT FOURNIS }{
+\b\i\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 TELS QUELS}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 }{\b\i\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 ET AVEC TOUS LES D\'c9
+FAUTS }{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 PAR MICROSOFT ET SES FOURNISSEURS, LESQUELS PAR LES PR\'c9SENTES D\'c9NIENT TOUTES AUTRES GARANTIES ET CONDITIONS EXPRESSES, IMPLICITES OU EN VERTU DE LA LOI, NOTAMMENT}{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 , MAIS SANS LIMITATION,}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 (LE CAS \'c9CH\'c9ANT) LES GARANTIES, DEVOIRS OU CONDITIONS IMPLICITES DE QUALIT\'c9 MARCHANDE, D
+\rquote ADAPTATION \'c0 UN}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 E}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 }{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 FIN }{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 PARTICULI}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 \'c8}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 R}{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 E}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 , }{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 DE FIABILIT\'c9 OU DE DISPONIBILIT\'c9, }{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 D\rquote EXACTITUDE OU D\rquote EXHAUSTIVIT\'c9 DES R\'c9PONSES, DES R\'c9SULTATS, DES EFFORTS D\'c9PLOY\'c9S SELON LES R\'c8GLES DE L\rquote ART, D\rquote ABSENCE DE VIRUS ET }{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 D\rquote ABSENCE }{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 DE N\'c9GLIGENCE, LE TOUT \'c0 L\rquote \'c9GARD DU LOGICIEL ET DE LA PRESTATION OU DE L\rquote OMISSION D}{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 E LA }{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 PRESTATION}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 }{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 DES SERVICES DE SOUTIEN TECHNIQUE}{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 OU \'c0 L\rquote \'c9GARD DE LA FOURNITURE OU DE L\rquote
+OMISSION DE LA FOURNITURE DE TOUS AUTRES SERVICES, RENSEIGNEMENTS, LOGICIELS, ET CONTENU QUI S\rquote Y RAPPORTE GR\'c2CE AU LOGICIEL OU PROVENANT AUTREMENT DE L\rquote UTILISATION DU LOGICIEL }{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 . PAR AILLEURS, IL N\rquote Y A AUCUNE GARANTIE OU CONDITION QUANT AU TITRE DE PROPRI\'c9T\'c9, \'c0 LA JOUISSANCE OU LA POSSESSION PAISIBLE, \'c0 LA CONCORDANCE \'c0
+ UNE DESCRIPTION NI QUANT \'c0 UNE ABSENCE DE CONTREFA\'c7ON CONCERNANT LE LOGICIEL.
+\par }{\b\f36\ul\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid2979837 EXCLUSION DES DOMMAGES ACCESSOIRES, INDIRECTS ET DE CERTAINS AUTRES DOMMAGES}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910
+. DANS LA MESURE MAXIMALE PERMISE PAR LES LOIS APPLICABLES, EN AUCUN CAS MICROSOFT OU SES FOURNISSEURS NE SERONT RESPONSABLES DES DOMMAGES SP\'c9CIAUX, CONS\'c9CUTIFS, ACCESSOIRES OU INDIRECTS DE QUELQUE NATURE QUE CE SOIT (NOTAMMENT, LES DOMMAGES \'c0 L
+\rquote \'c9GARD DU MANQUE \'c0 GAGNER OU DE LA DIVULGATION DE RENSEIGNEMENTS CONFIDENTIELS OU AUTRES, DE LA PERTE D\rquote EXPLOITATION, DE BLESSURES CORPORELLES, DE LA VIOLATION DE LA VIE PRIV\'c9E, DE L\rquote
+OMISSION DE REMPLIR TOUT DEVOIR, Y COMPRIS D\rquote AGIR DE BONNE FOI OU D\rquote EXERCER UN SOIN RAISONNABLE, DE LA N\'c9GLIGENCE ET DE TOUTE AUTRE PERTE P\'c9CUNIAIRE OU AUTRE PERTE DE QUELQUE NATURE QUE CE SOIT) SE RAPPORTANT DE QUELQUE MANI\'c8
+RE QUE CE SOIT \'c0 L\rquote UTILISATION DU LOGICIEL OU \'c0 L\rquote INCAPACIT\'c9 DE S\rquote EN SERVIR, \'c0 LA PRESTATION OU \'c0 L\rquote OMISSION D}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 E LA }{
+\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 PRESTATION DE SERVICES DE SOUTIEN TECHNIQUE }{\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422 OU \'c0 LA FOURNITURE OU \'c0 L\rquote
+OMISSION DE LA FOURNITURE DE TOUS AUTRES SERVICES, RENSEIGNEMENTS, LOGICIELS, ET CONTENU QUI S\rquote Y RAPPORTE GR\'c2CE AU LOGICIEL OU PROVENANT AUTREMENT DE L\rquote UTILISATION DU LOGICIEL}{
+\b\f36\lang3084\langfe1033\langnp3084\insrsid14224422\charrsid16606910 }{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 OU AUTREMENT AUX TERMES DE TOUTE DISPOSITION D}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 E LA }{
+\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 PR\'c9SENT}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 E}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 }{
+\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 CONVENTION }{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 OU RELATIVEMENT \'c0 UNE TELLE DISPOSITION, M\'caME EN CAS DE FAUTE, DE D\'c9LIT CIVIL (Y COMPRIS LA N\'c9
+GLIGENCE), DE RESPONSABILIT\'c9 STRICTE, DE VIOLATION DE CONTRAT OU DE VIOLATION DE GARANTIE DE MICROSOFT OU DE TOUT FOURNISSEUR ET M\'caME SI MICROSOFT OU TOUT FOURNISSEUR A \'c9T\'c9 AVIS\'c9 DE LA POSSIBILIT\'c9 DE TELS DOMMAGES.}{
+\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid3175708
+\par }{\b\f36\ul\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid2979837 LIMITATION DE RESPONSABILIT\'c9 ET RECOURS}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid3175708 . MALGR\'c9
+ LES DOMMAGES QUE VOUS PUISSIEZ SUBIR POUR QUELQUE MOTIF QUE CE SOIT (NOTAMMENT, }{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 MAIS SANS LIMITATION, }{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid3175708
+TOUS LES DOMMAGES SUSMENTIONN\'c9S ET TOUS LES DOMMAGES DIRECTS OU G\'c9N\'c9RAUX}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 OU AUTRES}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid3175708 ), L}{
+\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 A SEULE RESPONSABILIT\'c9 }{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid3175708 DE MICROSOFT ET DE L\rquote UN OU L\rquote AUTRE DE SES FOURNISSEURS AUX TERMES DE TOUTE DISPOSITION D}
+{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 E}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid3175708 }{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 LA }{
+\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid3175708 PR\'c9SENT}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 E}{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid3175708 }{
+\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422 CONVENTION }{\b\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid3175708 ET VOTRE RECOURS EXCLUSIF \'c0 L\rquote \'c9GARD DE TOUT CE QUI PR\'c9C\'c8DE SE LIMITE AU PLUS \'c9LEV\'c9
+ ENTRE LES MONTANTS SUIVANTS\~: LE MONTANT QUE VOUS AVEZ R\'c9ELLEMENT PAY\'c9 POUR LE LOGICIEL OU 5,00\~$US. LES LIMITES, EXCLUSIONS ET D\'c9NIS QUI PR\'c9C\'c8DENT (Y COMPRIS LES CLAUSES CI-DESSUS), S\rquote
+APPLIQUENT DANS LA MESURE MAXIMALE PERMISE PAR LES LOIS APPLICABLES, M\'caME SI TOUT RECOURS N\rquote ATTEINT PAS SON BUT ESSENTIEL.
+\par }{\f36\lang1036\langfe1033\langnp1036\insrsid14224422 \'c0 moins que cela ne soit prohib\'e9 par le droit local applicable, l}{\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 a pr\'e9sente Convention est r\'e9
+gie par les lois de la province d\rquote Ontario, Canada. }{\f36\lang1036\langfe1033\langnp1036\insrsid14224422 Vous consentez \'e0 }{\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 la comp\'e9tence des tribunaux }{
+\f36\lang1036\langfe1033\langnp1036\insrsid14224422 f\'e9d\'e9raux et provinciaux si\'e9geant \'e0 Toronto, dans }{\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 la province d\rquote Ontario.
+\par Au cas o\'f9 vous auriez des questions concernant cette licence ou que vous d\'e9siriez vous mettre en rapport avec Microsoft pour quelque raison que ce soit, veuillez }{\f36\lang1036\langfe1033\langnp1036\insrsid14224422 utiliser l\rquote
+information contenue dans le Logiciel pour }{\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 contacter la }{\f36\lang1036\langfe1033\langnp1036\insrsid14224422 filiale de }{
+\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 Microsoft desservant votre pays, ou }{\f36\lang1036\langfe1033\langnp1036\insrsid14224422 visitez }{\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 Microsoft }{
+\f36\lang1036\langfe1033\langnp1036\insrsid14224422 sur le }{\f36\cf1\lang1036\langfe1033\langnp1036\insrsid14224422 World Wide Web \'e0 }{\field\flddirty{\*\fldinst {\f36\cf1\lang1036\langfe1033\langnp1036\insrsid14224422
+ HYPERLINK "http://www.microsoft.com" }{\f36\cf1\insrsid14224422\charrsid14896281 {\*\datafield
+00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b3400000068007400740070003a002f002f007700770077002e006d006900630072006f0073006f00660074002e0063006f006d002f000000}}}{\fldrslt {
+\f36\ul\cf2\lang1036\langfe1033\langnp1036\insrsid14224422 http://www.microsoft.com}}}{\f36\lang1036\langfe1033\langnp1036\insrsid14224422\charrsid16606910 .}{\f36\lang1036\langfe1033\langnp1036\insrsid14224422
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\lang1036\langfe1033\langnp1036\insrsid14224422
+\par }{\b\f36\fs22\lang1036\langfe1033\langnp1036\insrsid14224422
+\par }\pard\plain \s23\ql \li0\ri0\sa60\widctlpar\tx576\tx1152\tx1728\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f38\fs22\lang1033\langfe1033\kerning22\cgrid\langnp1033\langfenp1033 {\f36\lang1036\langfe1033\langnp1036\insrsid14224422
+\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\lang1036\langfe1033\langnp1036\insrsid14224422
+\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\lang1036\langfe1033\langnp1036\insrsid14224422
+\par }}
\ No newline at end of file
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/EULA.txt b/windows_libs/Microsoft Visual C++ Toolkit 2003/EULA.txt
new file mode 100644
index 00000000..8ed77743
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/EULA.txt
@@ -0,0 +1,48 @@
+END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE
+
+MICROSOFT VISUAL C++ TOOLKIT 2003
+
+IMPORTANT-READ CAREFULLY: This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation ("Microsoft") for the Microsoft software that accompanies this EULA, which includes computer software and may include associated media, printed materials including best practices, white papers, templates, "online" or electronic documentation, and Internet-based services ("Software"). An amendment or addendum to this EULA may accompany the Software. YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE. IF YOU DO NOT AGREE, DO NOT INSTALL, COPY, OR USE THE SOFTWARE.
+
+
+
+MICROSOFT Software LICENSE
+1. GRANTS OF LICENSE. Microsoft grants you the rights described in this EULA provided that you comply with all terms and conditions of this EULA.
+1.1 General License Grant. Microsoft grants to you as an individual, a personal, nonexclusive license to make and use copies of the Software (i) for your internal use; (ii) for designing, developing, testing and demonstrating your software product(s); and (iii) for evaluation of the Software.
+1.2 Documentation. You may make and use an unlimited number of copies of any documentation, provided that such copies shall be used only for personal internal purposes and are not to be republished or distributed (either in hard copy or electronic form) beyond your premises except as otherwise specifically provided herein.
+2. ADDITIONAL LICENSE RIGHTS -- REDISTRIBUTABLES. In addition to the rights granted in Section 1, certain portions of the Software, as described in this Section˙2, are provided to you with additional license rights. These additional license rights are conditioned upon your compliance with the distribution requirements and license restrictions described in Section 3.
+2.1 Sample Code. Microsoft grants you the right to use and modify the source code version of those portions of the Software identified as "Samples" in REDIST.TXT or elsewhere in the Software ("Sample Code") for the sole purposes of designing, developing, and testing your software product(s), and to reproduce and distribute the Sample Code along with any modifications thereof, in object and/or source code form. For applicable redistribution requirements for Sample Code, see Section˙3.1 below.
+2.2 Redistributable Code-General. Microsoft grants you a nonexclusive, royalty-free right to reproduce and distribute the object code form of any portion of the Software listed in REDIST.TXT ("Redistributable Code"). For general redistribution requirements for Redistributable Code, see Section˙3.1, below.
+
+
+3. LICENSE RESTRICTIONS -- DISTRIBUTION REQUIREMENTS. If you choose to exercise your rights under Section˙2, any redistribution by you is subject to your compliance with the following terms.
+3.1 If you are authorized and choose to redistribute Sample Code or Redistributable Code (collectively, the "Redistributables") as described in Section 2, you agree: (i) except as otherwise noted in Section 2.1 (Sample Code) to distribute the Redistributables only in object code form and in conjunction with and as a part of a software application product developed by you that adds significant and primary functionality to the Redistributables ("Licensee Software"); (ii)˙that the Redistributables only operate in conjunction with Microsoft Windows platforms; (iii) to distribute the Licensee Software containing the Redistributables pursuant to an end user license agreement (which may be "break-the-seal", "click-wrap" or signed), with terms no less protective than those contained in this EULA; (iv)˙not to use Microsoft's name, logo, or trademarks to market the Licensee Software; (v) to display your own valid copyright notice which shall be sufficient to protect Microsoft's copyright in the Software; (vi)˙not to remove or obscure any copyright, trademark or patent notices that appear on the Software as delivered to you; (vii) to indemnify, hold harmless, and defend Microsoft from and against any claims or lawsuits, including attorney's fees, that arise or result from the use or distribution of the Licensee Software; (viii) otherwise comply with the terms of this EULA; and (ix)˙agree that Microsoft reserves all rights not expressly granted.
+You also agree not to permit further distribution of the Redistributables by your end users except you may permit further redistribution of the Redistributables by your distributors to your end-user customers if your distributors only distribute the Redistributables in conjunction with, and as part of, the Licensee Software and you and your distributors comply with all other terms of this EULA.
+3.2 If you use the Redistributables, then in addition to your compliance with the applicable distribution requirements described for the Redistributables, the following also applies. Your license rights to the Redistributables are conditioned upon your not (a) creating derivative works of the Redistributables in any manner that would cause the Redistributables in whole or in part to become subject to any of the terms of an Excluded License; and (b) distributing the Redistributables (or derivative works thereof) in any manner that would cause the Redistributables to become subject to any of the terms of an Excluded License. An "Excluded License" is any license which requires as a condition of use, modification and/or distribution of software subject to the Excluded License, that such software or other software combined and/or distributed with such software (x) be disclosed or distributed in source code form; (y) be licensed for the purpose of making derivative works; or (z) be redistributable at no charge.
+4. RESERVATION OF RIGHTS AND OWNERSHIP. Microsoft reserves all rights not expressly granted to you in this EULA. The Software is protected by copyright and other intellectual property laws and treaties. Microsoft or its suppliers own the title, copyright, and other intellectual property rights in the Software. The Software is licensed, not sold.
+5. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. You may not reverse engineer, decompile, or disassemble the Software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
+6. NO RENTAL/COMMERCIAL HOSTING. You may not rent, lease, lend, or provide commercial hosting services with the Software.
+7. CONSENT TO USE OF DATA. You agree that Microsoft and its affiliates may collect and use technical information gathered as part of the product support services provided to you, if any, related to the Software. Microsoft may use this information solely to improve our products or to provide customized services or technologies to you and will not disclose this information in a form that personally identifies you.
+8. LINKS TO THIRD PARTY SITES. You may link to third party sites through the use of the Software. The third party sites are not under the control of Microsoft, and Microsoft is not responsible for the contents of any third party sites, any links contained in third party sites, or any changes or updates to third party sites. Microsoft is not responsible for webcasting or any other form of transmission received from any third party sites. Microsoft is providing these links to third party sites to you only as a convenience, and the inclusion of any link does not imply an endorsement by Microsoft of the third party site.
+9. ADDITIONAL SOFTWARE/SERVICES. This EULA applies to updates, supplements, add-on components, or Internet-based services components, of the Software that Microsoft may provide to you or make available to you after the date you obtain your initial copy of the Software, unless we provide other terms along with the update, supplement, add-on component, or Internet-based services component. Microsoft reserves the right to discontinue any Internet-based services provided to you or made available to you through the use of the Software.
+10. EXPORT RESTRICTIONS. You acknowledge that the Software is subject to U.S. export jurisdiction. You agree to comply with all applicable international and national laws that apply to the Software, including the U.S. Export Administration Regulations, as well as end-user, end-use, and destination restrictions issued by U.S. and other governments. For additional information, see .
+11. SOFTWARE TRANSFER. The initial user of the Software may make a one-time permanent transfer of this EULA and Software to another end user, provided the initial user retains no copies of the Software. This transfer must include all of the Software (including all component parts, the media and printed materials, any upgrades to this EULA, and, if applicable, the Certificate of Authenticity). The transfer may not be an indirect transfer, such as a consignment. Prior to the transfer, the end user receiving the Software must agree to all the EULA terms.
+12. TERMINATION. Without prejudice to any other rights, Microsoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the Software and all of its component parts.
+13. DISCLAIMER OF WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND ITS SUPPLIERS PROVIDE THE SOFTWARE AND SUPPORT SERVICES (IF ANY) AS IS AND WITH ALL FAULTS, AND HEREBY DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES, DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF RELIABILITY OR AVAILABILITY, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE, ALL WITH REGARD TO THE SOFTWARE, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT OR OTHER SERVICES, INFORMATION, SOFTWARE, AND RELATED CONTENT THROUGH THE SOFTWARE OR OTHERWISE ARISING OUT OF THE USE OF THE SOFTWARE. ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE SOFTWARE.
+14. EXCLUSION OF INCIDENTAL, CONSEQUENTIAL AND CERTAIN OTHER DAMAGES. To the maximum extent permitted by applicable law, in no event shall Microsoft or its suppliers be liable for any special, incidental, punitive, indirect, or consequential damages whatsoever (including, but not limited to, damages for loss of profits or confidential or other information, for business interruption, for personal injury, for loss of privacy, for failure to meet any duty including of good faith or of reasonable care, for negligence, and for any other pecuniary or other loss whatsoever) arising out of or in any way related to the use of or inability to use the SOFTWARE, the provision of or failure to provide Support OR OTHER Services, informatIon, software, and related CONTENT through the software or otherwise arising out of the use of the software, or otherwise under or in connection with any provision of this EULA, even in the event of the fault, tort (including negligence), misrepresentation, strict liability, breach of contract or breach of warranty of Microsoft or any supplier, and even if Microsoft or any supplier has been advised of the possibility of such damages.
+15. LIMITATION OF LIABILITY AND REMEDIES. NOTWITHSTANDING ANY DAMAGES THAT YOU MIGHT INCUR FOR ANY REASON WHATSOEVER (INCLUDING, WITHOUT LIMITATION, ALL DAMAGES REFERENCED HEREIN AND ALL DIRECT OR GENERAL DAMAGES IN CONTRACT OR ANYTHING ELSE), THE ENTIRE LIABILITY OF MICROSOFT AND ANY OF ITS SUPPLIERS UNDER ANY PROVISION OF THIS EULA AND YOUR EXCLUSIVE REMEDY HEREUNDER SHALL BE LIMITED TO THE GREATER OF THE ACTUAL DAMAGES YOU INCUR IN REASONABLE RELIANCE ON THE SOFTWARE UP TO THE AMOUNT ACTUALLY PAID BY YOU FOR THE SOFTWARE OR US$5.00. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS ITS ESSENTIAL PURPOSE.
+16. APPLICABLE LAW. If you acquired this Software in the United States, this EULA is governed by the laws of the State of Washington. If you acquired this Software in Canada, unless expressly prohibited by local law, this EULA is governed by the laws in force in the Province of Ontario, Canada; and, in respect of any dispute which may arise hereunder, you consent to the jurisdiction of the federal and provincial courts sitting in Toronto, Ontario. If you acquired this Software in the European Union, Iceland, Norway, or Switzerland, then local law applies. If you acquired this Software in any other country, then local law may apply.
+17. U.S. GOVERNMENT LICENSE RIGHTS. All Software provided to the U.S. Government pursuant to solicitations issued on or after December 1, 1995 is provided with the commercial license rights and restrictions described elsewhere herein. All Software provided to the U.S. Government pursuant to solicitations issued prior to December 1, 1995 is provided with "Restricted Rights" as provided for in FAR, 48 CFR 52.227-14 (JUNE 1987) or DFAR, 48 CFR 252.227-7013 (OCT 1988), as applicable.
+18. ENTIRE AGREEMENT; SEVERABILITY. This EULA (including any addendum or amendment to this EULA which is included with the Software) are the entire agreement between you and Microsoft relating to the Software and the support services (if any) and they supersede all prior or contemporaneous oral or written communications, proposals and representations with respect to the Software or any other subject matter covered by this EULA. To the extent the terms of any Microsoft policies or programs for support services conflict with the terms of this EULA, the terms of this EULA shall control. If any provision of this EULA is held to be void, invalid, unenforceable or illegal, the other provisions shall continue in full force and effect.
+Should you have any questions concerning this EULA, or if you desire to contact Microsoft for any reason, please use the address information enclosed in this Software to contact the Microsoft subsidiary serving your country or visit Microsoft on the World Wide Web at http://www.microsoft.com.
+
+Si vous avez acquis votre produit Microsoft au CANADA, la garantie limite suivante s'applique˙:
+DNI DE GARANTIES. DANS LA MESURE MAXIMALE PERMISE PAR LES LOIS APPLICABLES, LE LOGICIEL ET LES SERVICES DE SOUTIEN TECHNIQUE (LE CAS CHANT) SONT FOURNIS TELS QUELS ET AVEC TOUS LES DFAUTS PAR MICROSOFT ET SES FOURNISSEURS, LESQUELS PAR LES PRSENTES DNIENT TOUTES AUTRES GARANTIES ET CONDITIONS EXPRESSES, IMPLICITES OU EN VERTU DE LA LOI, NOTAMMENT, MAIS SANS LIMITATION, (LE CAS CHANT) LES GARANTIES, DEVOIRS OU CONDITIONS IMPLICITES DE QUALIT MARCHANDE, D'ADAPTATION A UNE FIN PARTICULIERE, DE FIABILIT OU DE DISPONIBILIT, D'EXACTITUDE OU D'EXHAUSTIVIT DES RPONSES, DES RSULTATS, DES EFFORTS DPLOYS SELON LES REGLES DE L'ART, D'ABSENCE DE VIRUS ET D'ABSENCE DE NGLIGENCE, LE TOUT A L'GARD DU LOGICIEL ET DE LA PRESTATION OU DE L'OMISSION DE LA PRESTATION DES SERVICES DE SOUTIEN TECHNIQUE OU A L'GARD DE LA FOURNITURE OU DE L'OMISSION DE LA FOURNITURE DE TOUS AUTRES SERVICES, RENSEIGNEMENTS, LOGICIELS, ET CONTENU QUI S'Y RAPPORTE GRACE AU LOGICIEL OU PROVENANT AUTREMENT DE L'UTILISATION DU LOGICIEL . PAR AILLEURS, IL N'Y A AUCUNE GARANTIE OU CONDITION QUANT AU TITRE DE PROPRIT, A LA JOUISSANCE OU LA POSSESSION PAISIBLE, A LA CONCORDANCE A UNE DESCRIPTION NI QUANT A UNE ABSENCE DE CONTREFAON CONCERNANT LE LOGICIEL.
+EXCLUSION DES DOMMAGES ACCESSOIRES, INDIRECTS ET DE CERTAINS AUTRES DOMMAGES. DANS LA MESURE MAXIMALE PERMISE PAR LES LOIS APPLICABLES, EN AUCUN CAS MICROSOFT OU SES FOURNISSEURS NE SERONT RESPONSABLES DES DOMMAGES SPCIAUX, CONSCUTIFS, ACCESSOIRES OU INDIRECTS DE QUELQUE NATURE QUE CE SOIT (NOTAMMENT, LES DOMMAGES A L'GARD DU MANQUE A GAGNER OU DE LA DIVULGATION DE RENSEIGNEMENTS CONFIDENTIELS OU AUTRES, DE LA PERTE D'EXPLOITATION, DE BLESSURES CORPORELLES, DE LA VIOLATION DE LA VIE PRIVE, DE L'OMISSION DE REMPLIR TOUT DEVOIR, Y COMPRIS D'AGIR DE BONNE FOI OU D'EXERCER UN SOIN RAISONNABLE, DE LA NGLIGENCE ET DE TOUTE AUTRE PERTE PCUNIAIRE OU AUTRE PERTE DE QUELQUE NATURE QUE CE SOIT) SE RAPPORTANT DE QUELQUE MANIERE QUE CE SOIT A L'UTILISATION DU LOGICIEL OU A L'INCAPACIT DE S'EN SERVIR, A LA PRESTATION OU A L'OMISSION DE LA PRESTATION DE SERVICES DE SOUTIEN TECHNIQUE OU A LA FOURNITURE OU A L'OMISSION DE LA FOURNITURE DE TOUS AUTRES SERVICES, RENSEIGNEMENTS, LOGICIELS, ET CONTENU QUI S'Y RAPPORTE GRACE AU LOGICIEL OU PROVENANT AUTREMENT DE L'UTILISATION DU LOGICIEL OU AUTREMENT AUX TERMES DE TOUTE DISPOSITION DE LA PRSENTE CONVENTION OU RELATIVEMENT A UNE TELLE DISPOSITION, MEME EN CAS DE FAUTE, DE DLIT CIVIL (Y COMPRIS LA NGLIGENCE), DE RESPONSABILIT STRICTE, DE VIOLATION DE CONTRAT OU DE VIOLATION DE GARANTIE DE MICROSOFT OU DE TOUT FOURNISSEUR ET MEME SI MICROSOFT OU TOUT FOURNISSEUR A T AVIS DE LA POSSIBILIT DE TELS DOMMAGES.
+LIMITATION DE RESPONSABILIT ET RECOURS. MALGR LES DOMMAGES QUE VOUS PUISSIEZ SUBIR POUR QUELQUE MOTIF QUE CE SOIT (NOTAMMENT, MAIS SANS LIMITATION, TOUS LES DOMMAGES SUSMENTIONNS ET TOUS LES DOMMAGES DIRECTS OU GNRAUX OU AUTRES), LA SEULE RESPONSABILIT DE MICROSOFT ET DE L'UN OU L'AUTRE DE SES FOURNISSEURS AUX TERMES DE TOUTE DISPOSITION DE LA PRSENTE CONVENTION ET VOTRE RECOURS EXCLUSIF A L'GARD DE TOUT CE QUI PRCEDE SE LIMITE AU PLUS LEV ENTRE LES MONTANTS SUIVANTS˙: LE MONTANT QUE VOUS AVEZ RELLEMENT PAY POUR LE LOGICIEL OU 5,00˙$US. LES LIMITES, EXCLUSIONS ET DNIS QUI PRCEDENT (Y COMPRIS LES CLAUSES CI-DESSUS), S'APPLIQUENT DANS LA MESURE MAXIMALE PERMISE PAR LES LOIS APPLICABLES, MEME SI TOUT RECOURS N'ATTEINT PAS SON BUT ESSENTIEL.
+A moins que cela ne soit prohib par le droit local applicable, la prsente Convention est rgie par les lois de la province d'Ontario, Canada. Vous consentez la comptence des tribunaux fdraux et provinciaux sigeant Toronto, dans la province d'Ontario.
+Au cas o vous auriez des questions concernant cette licence ou que vous dsiriez vous mettre en rapport avec Microsoft pour quelque raison que ce soit, veuillez utiliser l'information contenue dans le Logiciel pour contacter la filiale de Microsoft desservant votre pays, ou visitez Microsoft sur le World Wide Web http://www.microsoft.com.
+
+
+
+
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/README.htm b/windows_libs/Microsoft Visual C++ Toolkit 2003/README.htm
new file mode 100644
index 00000000..13158d46
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/README.htm
@@ -0,0 +1,860 @@
+
+
+
+
+
+
+
+
+Thank you for choosing the Visual C++ Toolkit 2003
+
+
+
+
+
+
+
+
+
+
+
Thank you for choosing the
+Visual C++ Toolkit!
+
+
+
+
Use the free Visual C++ Toolkit to build your ISO C++ Standard code, to
+evaluate new compiler features, and to get a feel for some of the capabilities
+included with Visual Studio .NET
+2003. The tools and libraries
+included with the Toolkit are a subset of the features and capabilities of
+Visual Studio .NET 2003
+Professional.Buy Visual Studio .NET 2003 Professional and get a full Integrated
+Development Environment (IDE), an award-winning debugger, additional C++
+libraries including ATL and MFC, and much more.
The Visual C++ Toolkit 2003 is a free download and does not include
+customer support or specific documentation. Please refer to documentation
+for the Visual C++ compiler and libraries online at:
Please refer to the End User License Agreement (EULA.TXT) and
+Redistributable File List (REDIST.TXT) for complete licensing
+information. In general, applications and components built using the
+Visual C++ Toolkit may be redistributed without restriction.
+
+
+
+
The Visual C++ Toolkit includes the core tools and libraries necessary
+to build basic C++ applications and programs:
+
+
+
+
+
Microsoft
+ C/C++ Optimizing Compiler and Linker. These are the same compiler
+ and linker that ship with Visual Studio .NET
+ 2003 Professional!
+
+
+
+
+
+
C Runtime
+ Library and the C++ Standard Library, including the Standard Template
+ Library. These are the same static-link libraries included with
+ Visual Studio. Visual Studio also ships these libraries in
+ dynamic-link versions, and with full source code.
+
+
+
+
+
+
Microsoft .NET Framework Common Language Runtime.
+ Visual C++ can optionally build applications that run on the Common
+ Language Runtime (CLR).
+
+
+
+
+
+
Sample
+ code. The toolkit includes four samples designed to showcase the
+ powerful new features of the 2003 version, including new optimization capabilities,
+ features to improve code-security and robustness, enhanced ISO C++
+ standards support, and the ability to use the .NET
+ Framework library and target the CLR.
+
+
+
+
+
The Visual C++ Toolkit does not include several core features found in
+Visual Studio .NET 2003.
+
+
+
+
+
Visual Studio
+ Integrated Development Environment (IDE). The Visual Studio IDE
+ incorporates multitudes of developer tools
+ including code editors, the Visual Studio debugger, and a project
+ system. Learn more about Visual Studio at http://msdn.microsoft.com/vstudio.
+
+
+
+
+
+
Microsoft
+ Foundation Class (MFC) and Active Template Libraries (ATL). These
+ robust and mature libraries provide C++ developers with encapsulated
+ functionality for building Windows-based applications. In
+ Visual Studio these are provided with complete source code.
+
+
+
+
+
+
Advanced developer tools, including compilers and tools
+ for developing using other languages like Visual Basic and C#.
+ Visual Studio provides developers with a complete toolset for building all
+ types of applications and components for Windows and .NET.
+
+
+
+
+
Using the Visual C++ Toolkit
+
+
+
+
The Visual C++ Toolkit installs the Visual C++ Toolkit 2003 Command
+Prompt into the Start Menu. This command-shell window is configured to
+enable compilation and linking of C++ programs using the toolkit-provided
+tools.
+
+
+
+
A batch file (vcvars32.bat) in the Toolkit installation directory sets
+the environment variables (PATH, INCLUDE, LIB) to point at Toolkit
+directories. Execute this batch file from any command prompt to configure
+for compilation using the Toolkit compiler.
+
+
+
+
There are four samples included with the Toolkit, located in the
+Samples subdirectory. These short samples showcase new or updated
+capabilities of the Visual C++ compiler. Each sample includes a short
+whitepaper explaining the sample, and one or more batch files that can be used
+to compile the sample code.
+
+
+
+
Next Steps
+
+
+
+
Once youve familiarized yourself with the Visual C++ compiler and the
+samples included with the Toolkit, youre ready to build! You can use the
+Toolkit to build a variety of C++-based programs, using core C++ libraries and
+the .NET Framework. If you like,
+you can augment the toolkit with additional free developer
+ tools and resources. For example, you can download any of
+the following:
If you have any questions about the C++ programming, or the Toolkit
+itself, we highly recommend visiting a C++ newsgroup or community site.
+The free Toolkit does not include technical support, but many questions about
+Visual C++ are answered online. Start by checking the Visual C++ FAQ:
When youre ready, we suggest you check out Visual Studio .NET 2003 Professional, which includes lots of
+additional functionality for C++ developers, including an award-winning IDE and
+code debugger, additional libraries, and much more!You can try out Visual Studio for free,
+online.Visit http://msdn.microsoft.com/vstudio/tryit/
+for more information.
+
+
+
+
Uninstalling the Visual C++ Toolkit
+
+
+
+
Use the Add/Remove Programs tool in the Windows Control Panel to
+uninstall the Visual C++ Toolkit.
+
+
+
+
The Toolkit installs the Microsoft .NET Framework 1.1 if it is not previously
+installed. The uninstaller does not remove this shared component, but it
+may be removed manually using the Add/Remove Programs tool.
+
+
+
+
+
+
+
+
+
+
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/README.txt b/windows_libs/Microsoft Visual C++ Toolkit 2003/README.txt
new file mode 100644
index 00000000..802bf404
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/README.txt
@@ -0,0 +1,66 @@
+Thank you for choosing the Visual C++ Toolkit!
+
+Use the free Visual C++ Toolkit to build your ISO C++ Standard code, to evaluate new compiler features, and to get a feel for some of the capabilities included with Visual Studio .NET 2003. The tools and libraries included with the Toolkit are a subset of the features and capabilities of Visual Studio .NET 2003 Professional. Buy Visual Studio .NET 2003 Professional and get a full Integrated Development Environment (IDE), an award-winning debugger, additional C++ libraries including ATL and MFC, and much more.
+
+Learn more about Visual C++ at http://msdn.microsoft.com/visualc
+
+Learn more about Visual Studio at http://msdn.microsoft.com/vstudio/
+
+
+What's Included, and What's Not Included
+
+The Visual C++ Toolkit 2003 is a free download and does not include customer support or specific documentation. Please refer to documentation for the Visual C++ compiler and libraries online at:
+
+http://msdn.microsoft.com/library/en-us/vcedit/html/vcorivisualcmainnode.asp
+
+Please refer to the End User License Agreement (EULA.TXT) and Redistributable File List (REDIST.TXT) for complete licensing information. In general, applications and components built using the Visual C++ Toolkit may be redistributed without restriction.
+
+The Visual C++ Toolkit includes the core tools and libraries necessary to build basic C++ applications and programs:
+
+1. Microsoft C/C++ Optimizing Compiler and Linker. These are the same compiler and linker that ship with Visual Studio .NET 2003 Professional!
+
+2. C Runtime Library and the C++ Standard Library, including the Standard Template Library. These are the same static-link libraries included with Visual Studio. Visual Studio also ships these libraries in dynamic-link versions, and with full source code.
+
+3. Microsoft .NET Framework Common Language Runtime. Visual C++ can optionally build applications that run on the Common Language Runtime (CLR).
+
+4. Sample code. The toolkit includes four samples designed to showcase the powerful new features of the 2003 version, including new optimization capabilities, features to improve code-security and robustness, enhanced ISO C++ standards support, and the ability to use the .NET Framework library and target the CLR.
+
+The Visual C++ Toolkit does not include several core features found in Visual Studio .NET 2003.
+
+1. Visual Studio Integrated Development Environment (IDE). The Visual Studio IDE incorporates multitudes of developer tools including code editors, the Visual Studio debugger, and a project system. Learn more about Visual Studio at http://msdn.microsoft.com/vstudio.
+
+2. Microsoft Foundation Class (MFC) and Active Template Libraries (ATL). These robust and mature libraries provide C++ developers with encapsulated functionality for building Windows-based applications. In Visual Studio these are provided with complete source code.
+
+3. Advanced developer tools, including compilers and tools for developing using other languages like Visual Basic and C#. Visual Studio provides developers with a complete toolset for building all types of applications and components for Windows and .NET.
+
+Using the Visual C++ Toolkit
+
+The Visual C++ Toolkit installs the "Visual C++ Toolkit 2003 Command Prompt" into the Start Menu. This command-shell window is configured to enable compilation and linking of C++ programs using the toolkit-provided tools.
+
+A batch file (vcvars32.bat) in the Toolkit installation directory sets the environment variables (PATH, INCLUDE, LIB) to point at Toolkit directories. Execute this batch file from any command prompt to configure for compilation using the Toolkit compiler.
+
+There are four samples included with the Toolkit, located in the Samples subdirectory. These short samples showcase new or updated capabilities of the Visual C++ compiler. Each sample includes a short whitepaper explaining the sample, and one or more batch files that can be used to compile the sample code.
+
+Next Steps
+
+Once you've familiarized yourself with the Visual C++ compiler and the samples included with the Toolkit, you're ready to build! You can use the Toolkit to build a variety of C++-based programs, using core C++ libraries and the .NET Framework. If you like, you can augment the toolkit with additional free developer tools and resources. For example, you can download any of the following:
+
+* Microsoft Platform SDK. This Software Developer Kit provides extensive headers and libraries for building Win32-based applications. And it includes additional developer tools as well! http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
+
+* Microsoft .NET Framework SDK Version 1.1. The Visual C++ Toolkit installs a subset of the full .NET Framework SDK. Install the full SDK to gain access to documentation and additional tools. http://www.microsoft.com/downloads/details.aspx?FamilyId=9B3A2CA6-3647-4070-9F41-A333C6B9181D&displaylang=en
+
+* DirectX 9.0 SDK. Install the DirectX 9 SDK and get started building cool software with full 3D rendering capabilities. Lots of samples are included. http://www.microsoft.com/downloads/details.aspx?FamilyID=1d97f320-9dfd-4e7a-b947-3a037ccf84af&displaylang=en
+
+If you have any questions about the C++ programming, or the Toolkit itself, we highly recommend visiting a C++ newsgroup or community site. The free Toolkit does not include technical support, but many questions about Visual C++ are answered online. Start by checking the Visual C++ FAQ:
+
+http://msdn.microsoft.com/visualc/productinfo/faq
+
+When you're ready, we suggest you check out Visual Studio .NET 2003 Professional, which includes lots of additional functionality for C++ developers, including an award-winning IDE and code debugger, additional libraries, and much more! You can try out Visual Studio for free, online. Visit http://msdn.microsoft.com/vstudio/tryit/ for more information.
+
+Uninstalling the Visual C++ Toolkit
+
+Use the Add/Remove Programs tool in the Windows Control Panel to uninstall the Visual C++ Toolkit.
+
+The Toolkit installs the 'Microsoft .NET Framework 1.1' if it is not previously installed. The uninstaller does not remove this shared component, but it may be removed manually using the Add/Remove Programs tool.
+
+
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/Visual C++ Toolkit 2003 Command Prompt.lnk b/windows_libs/Microsoft Visual C++ Toolkit 2003/Visual C++ Toolkit 2003 Command Prompt.lnk
new file mode 100644
index 00000000..8047b62e
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/Visual C++ Toolkit 2003 Command Prompt.lnk differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/c1.dll b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/c1.dll
new file mode 100644
index 00000000..4df787bd
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/c1.dll differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/c1xx.dll b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/c1xx.dll
new file mode 100644
index 00000000..7bc5d884
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/c1xx.dll differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/c2.dll b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/c2.dll
new file mode 100644
index 00000000..4318ca5a
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/c2.dll differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/cl.exe b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/cl.exe
new file mode 100644
index 00000000..086519c6
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/cl.exe differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/cl.exe.config b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/cl.exe.config
new file mode 100644
index 00000000..80e3a3fb
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/cl.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/dbghelp.dll b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/dbghelp.dll
new file mode 100644
index 00000000..ac6f75fa
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/dbghelp.dll differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/link.exe b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/link.exe
new file mode 100644
index 00000000..4f2dfe82
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/link.exe differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/link.exe.config b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/link.exe.config
new file mode 100644
index 00000000..80e3a3fb
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/link.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/msobj71.dll b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/msobj71.dll
new file mode 100644
index 00000000..fefbb8da
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/msobj71.dll differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/mspdb71.dll b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/mspdb71.dll
new file mode 100644
index 00000000..0294b093
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/mspdb71.dll differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/msvcp71.dll b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/msvcp71.dll
new file mode 100644
index 00000000..9ed0d17e
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/msvcp71.dll differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/msvcr71.dll b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/msvcr71.dll
new file mode 100644
index 00000000..9d9e0286
Binary files /dev/null and b/windows_libs/Microsoft Visual C++ Toolkit 2003/bin/msvcr71.dll differ
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/_vcclrit.h b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/_vcclrit.h
new file mode 100644
index 00000000..0292c51e
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/_vcclrit.h
@@ -0,0 +1,135 @@
+/***
+*_vcclrit.h
+*
+* Copyright (c) Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines the functions and variables used by user
+* to initialize CRT and the dll in IJW scenario.
+*
+****/
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern IMAGE_DOS_HEADER __ImageBase;
+
+BOOL WINAPI _DllMainCRTStartup(
+ HANDLE hDllHandle,
+ DWORD dwReason,
+ LPVOID lpreserved
+ );
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef _cplusplus
+#define __USE_GLOBAL_NAMESPACE ::
+#else
+#define __USE_GLOBAL_NAMESPACE
+#endif
+
+// Used to lock
+__declspec( selectany ) LONG volatile __lock_handle = 0;
+
+// Init called
+__declspec(selectany) BOOL volatile __initialized = FALSE;
+
+// Term called
+__declspec( selectany ) BOOL volatile __terminated = FALSE;
+
+__inline BOOL WINAPI __crt_dll_initialize()
+{
+ // Try to make the variable names unique, so that the variables don't even clash with macros.
+ static BOOL volatile (__retval) = FALSE;
+ static DWORD volatile (__lockThreadId) = 0xffffffff;
+ DWORD volatile (__currentThreadId) = __USE_GLOBAL_NAMESPACE(GetCurrentThreadId)();
+ int (__int_var)=0;
+
+ // Take Lock, This is needed for multithreaded scenario. Moreover the threads
+ // need to wait here to make sure that the dll is initialized when they get
+ // past this function.
+ while ( __USE_GLOBAL_NAMESPACE(InterlockedExchange)( &(__lock_handle), 1) == 1 )
+ {
+ ++(__int_var);
+ if ((__lockThreadId) == (__currentThreadId))
+ {
+ return TRUE;
+ }
+ __USE_GLOBAL_NAMESPACE(Sleep)( (__int_var)>1000?100:0 );
+
+ // If you hang in this loop, this implies that your dllMainCRTStartup is hung on another
+ // thread. The most likely cause of this is a hang in one of your static constructors or
+ // destructors.
+ }
+ // Note that we don't really need any interlocked stuff here as the writes are always
+ // in the lock. Only reads are outside the lock.
+ (__lockThreadId) = (__currentThreadId);
+ __try {
+
+ if ( (__terminated) == TRUE )
+ {
+ (__retval) = FALSE;
+ }
+ else if ( (__initialized) == FALSE )
+ {
+ (__retval) = (_DllMainCRTStartup)( ( HINSTANCE )( &__ImageBase ), DLL_PROCESS_ATTACH, 0 );
+ (__initialized) = TRUE;
+ }
+
+ } __finally {
+ // revert the __lockThreadId
+ (__lockThreadId) = 0xffffffff;
+ // Release Lock
+ __USE_GLOBAL_NAMESPACE(InterlockedExchange)( &(__lock_handle), 0 );
+ }
+ return (__retval);
+}
+
+__inline BOOL WINAPI __crt_dll_terminate()
+{
+ static BOOL volatile (__retval) = TRUE;
+ static DWORD volatile (__lockThreadId) = 0xffffffff;
+ DWORD volatile (__currentThreadId) = __USE_GLOBAL_NAMESPACE(GetCurrentThreadId)();
+ int (__int_var)=0;
+
+ // Take Lock, this lock is needed to keep Terminate in sync with Initialize.
+ while ( __USE_GLOBAL_NAMESPACE(InterlockedExchange)( &(__lock_handle), 1) == 1 )
+ {
+ ++(__int_var);
+ if ((__lockThreadId) == (__currentThreadId))
+ {
+ return TRUE;
+ }
+ __USE_GLOBAL_NAMESPACE(Sleep)( (__int_var)>1000?100:0 );
+
+ // If you hang in this loop, this implies that your dllMainCRTStartup is hung on another
+ // thread. The most likely cause of this is a hang in one of your static constructors or
+ // destructors.
+ }
+ // Note that we don't really need any interlocked stuff here as the writes are always
+ // in the lock. Only reads are outside the lock.
+ (__lockThreadId) = (__currentThreadId);
+ __try {
+
+ if ( (__initialized) == FALSE )
+ {
+ (__retval) = FALSE;
+ }
+ else if ( (__terminated) == FALSE )
+ {
+ (__retval) = _DllMainCRTStartup( ( HINSTANCE )( &(__ImageBase) ), DLL_PROCESS_DETACH, 0 );
+ (__terminated) = TRUE;
+ }
+
+ } __finally {
+ // revert the __lockThreadId
+ (__lockThreadId) = 0xffffffff;
+ // Release Lock
+ __USE_GLOBAL_NAMESPACE(InterlockedExchange)( &(__lock_handle), 0 );
+ }
+ return (__retval);
+}
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/algorithm b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/algorithm
new file mode 100644
index 00000000..6cc8bb18
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/algorithm
@@ -0,0 +1,2678 @@
+// algorithm standard header
+#pragma once
+#ifndef _ALGORITHM_
+#define _ALGORITHM_
+#include
+
+#pragma pack(push,8)
+#pragma warning(push,3)
+ #pragma warning(disable: 4244)
+_STD_BEGIN
+
+ // COMMON SORT PARAMETERS
+const int _ISORT_MAX = 32; // maximum size for insertion sort
+
+ // TEMPLATE FUNCTION for_each
+template inline
+ _Fn1 for_each(_InIt _First, _InIt _Last, _Fn1 _Func)
+ { // perform function for each element
+ for (; _First != _Last; ++_First)
+ _Func(*_First);
+ return (_Func);
+ }
+
+ // TEMPLATE FUNCTION find
+template inline
+ _InIt find(_InIt _First, _InIt _Last, const _Ty& _Val)
+ { // find first matching _Val
+ for (; _First != _Last; ++_First)
+ if (*_First == _Val)
+ break;
+ return (_First);
+ }
+
+inline const char *find(const char *_First, const char *_Last, int _Val)
+ { // find first char that matches _Val
+ _First = (const char *)::memchr(_First, _Val, _Last - _First);
+ return (_First == 0 ? _Last : _First);
+ }
+
+inline const signed char *find(const signed char *_First,
+ const signed char *_Last, int _Val)
+ { // find first signed char that matches _Val
+ _First = (const signed char *)::memchr(_First, _Val,
+ _Last - _First);
+ return (_First == 0 ? _Last : _First);
+ }
+
+inline const unsigned char *find(const unsigned char *_First,
+ const unsigned char *_Last, int _Val)
+ { // find first unsigned char that matches _Val
+ _First = (const unsigned char *)::memchr(_First, _Val,
+ _Last - _First);
+ return (_First == 0 ? _Last : _First);
+ }
+
+ // TEMPLATE FUNCTION find_if
+template inline
+ _InIt find_if(_InIt _First, _InIt _Last, _Pr _Pred)
+ { // find first satisfying _Pred
+ for (; _First != _Last; ++_First)
+ if (_Pred(*_First))
+ break;
+ return (_First);
+ }
+
+ // TEMPLATE FUNCTION adjacent_find
+template inline
+ _FwdIt adjacent_find(_FwdIt _First, _FwdIt _Last)
+ { // find first matching successor
+ for (_FwdIt _Firstb; (_Firstb = _First) != _Last && ++_First != _Last; )
+ if (*_Firstb == *_First)
+ return (_Firstb);
+ return (_Last);
+ }
+
+ // TEMPLATE FUNCTION adjacent_find WITH PRED
+template inline
+ _FwdIt adjacent_find(_FwdIt _First, _FwdIt _Last, _Pr _Pred)
+ { // find first satisfying _Pred with successor
+ for (_FwdIt _Firstb; (_Firstb = _First) != _Last && ++_First != _Last; )
+ if (_Pred(*_Firstb, *_First))
+ return (_Firstb);
+ return (_Last);
+ }
+
+ // TEMPLATE FUNCTION count
+template inline
+ typename iterator_traits<_InIt>::difference_type
+ count(_InIt _First, _InIt _Last, const _Ty& _Val)
+ { // count elements that match _Val
+ typename iterator_traits<_InIt>::difference_type _Count = 0;
+
+ for (; _First != _Last; ++_First)
+ if (*_First == _Val)
+ ++_Count;
+ return (_Count);
+ }
+
+ // TEMPLATE FUNCTION count_if
+template inline
+ typename iterator_traits<_InIt>::difference_type
+ count_if(_InIt _First, _InIt _Last, _Pr _Pred)
+ { // count elements satisfying _Pred
+ typename iterator_traits<_InIt>::difference_type _Count = 0;
+
+ for (; _First != _Last; ++_First)
+ if (_Pred(*_First))
+ ++_Count;
+ return (_Count);
+ }
+
+
+ // TEMPLATE FUNCTION search
+template inline
+ _FwdIt1 _Search(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2, _Diff1 *, _Diff2 *)
+ { // find first [_First2, _Last2) match
+ _Diff1 _Count1 = 0;
+ _Distance(_First1, _Last1, _Count1);
+ _Diff2 _Count2 = 0;
+ _Distance(_First2, _Last2, _Count2);
+
+ for (; _Count2 <= _Count1; ++_First1, --_Count1)
+ { // room for match, try it
+ _FwdIt1 _Mid1 = _First1;
+ for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1, ++_Mid2)
+ if (_Mid2 == _Last2)
+ return (_First1);
+ else if (!(*_Mid1 == *_Mid2))
+ break;
+ }
+ return (_Last1);
+ }
+
+template inline
+ _FwdIt1 search(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2)
+ { // find first [_First2, _Last2) match
+ return (_Search(_First1, _Last1, _First2, _Last2,
+ _Dist_type(_First1), _Dist_type(_First2)));
+ }
+
+ // TEMPLATE FUNCTION search WITH PRED
+template inline
+ _FwdIt1 _Search(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred, _Diff1 *, _Diff2 *)
+ { // find first [_First2, _Last2) satisfying _Pred
+ _Diff1 _Count1 = 0;
+ _Distance(_First1, _Last1, _Count1);
+ _Diff2 _Count2 = 0;
+ _Distance(_First2, _Last2, _Count2);
+
+ for (; _Count2 <= _Count1; ++_First1, --_Count1)
+ { // room for match, try it
+ _FwdIt1 _Mid1 = _First1;
+ for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1, ++_Mid2)
+ if (_Mid2 == _Last2)
+ return (_First1);
+ else if (!_Pred(*_Mid1, *_Mid2))
+ break;
+ }
+ return (_Last1);
+ }
+
+template inline
+ _FwdIt1 search(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred)
+ { // find first [_First2, _Last2) satisfying _Pred
+ return (_Search(_First1, _Last1, _First2, _Last2, _Pred,
+ _Dist_type(_First1), _Dist_type(_First2)));
+ }
+
+ // TEMPLATE FUNCTION search_n
+template inline
+ _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _Diff2 _Count, const _Ty& _Val, _Diff1 *)
+ { // find first _Count * _Val match
+ _Diff1 _Count1 = 0;
+ _Distance(_First1, _Last1, _Count1);
+
+ for (; _Count <= _Count1; ++_First1, --_Count1)
+ { // room for match, try it
+ _FwdIt1 _Mid1 = _First1;
+ for (_Diff2 _Count2 = _Count; ; ++_Mid1, --_Count2)
+ if (_Count2 == 0)
+ return (_First1);
+ else if (!(*_Mid1 == _Val))
+ break;
+ }
+ return (_Last1);
+ }
+
+template inline
+ _FwdIt1 search_n(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _Diff2 _Count, const _Ty& _Val)
+ { // find first _Count * _Val match
+ return (_Search_n(_First1, _Last1, _Count, _Val, _Dist_type(_First1)));
+ }
+
+ // TEMPLATE FUNCTION search_n WITH PRED
+template inline
+ _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _Diff2 _Count, const _Ty& _Val, _Pr _Pred, _Diff1 *)
+ { // find first _Count * _Val satisfying _Pred
+ _Diff1 _Count1 = 0;
+ _Distance(_First1, _Last1, _Count1);
+
+ for (; _Count <= _Count1; ++_First1, --_Count1)
+ { // room for match, try it
+ _FwdIt1 _Mid1 = _First1;
+ for (_Diff2 _Count2 = _Count; ; ++_Mid1, --_Count2)
+ if (_Count2 == 0)
+ return (_First1);
+ else if (!_Pred(*_Mid1, _Val))
+ break;
+ }
+ return (_Last1);
+ }
+
+template inline
+ _FwdIt1 search_n(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _Diff2 _Count, const _Ty& _Val, _Pr _Pred)
+ { // find first _Count * _Val satisfying _Pred
+ return (_Search_n(_First1, _Last1,
+ _Count, _Val, _Pred, _Dist_type(_First1)));
+ }
+
+ // TEMPLATE FUNCTION find_end
+template inline
+ _FwdIt1 _Find_end(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2, _Diff1 *, _Diff2 *)
+ { // find last [_First2, _Last2) match
+ _Diff1 _Count1 = 0;
+ _Distance(_First1, _Last1, _Count1);
+ _Diff2 _Count2 = 0;
+ _Distance(_First2, _Last2, _Count2);
+ _FwdIt1 _Ans = _Last1;
+
+ if (0 < _Count2)
+ for (; _Count2 <= _Count1; ++_First1, --_Count1)
+ { // room for match, try it
+ _FwdIt1 _Mid1 = _First1;
+ for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1)
+ if (!(*_Mid1 == *_Mid2))
+ break;
+ else if (++_Mid2 == _Last2)
+ { // potential answer, save it
+ _Ans = _First1;
+ break;
+ }
+ }
+ return (_Ans);
+ }
+
+template inline
+ _FwdIt1 find_end(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2)
+ { // find last [_First2, _Last2) match
+ return (_Find_end(_First1, _Last1, _First2, _Last2,
+ _Dist_type(_First1), _Dist_type(_First2)));
+ }
+
+ // TEMPLATE FUNCTION find_end WITH PRED
+template inline
+ _FwdIt1 _Find_end(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred, _Diff1 *, _Diff2 *)
+ { // find last [_First2, _Last2) satisfying _Pred
+ _Diff1 _Count1 = 0;
+ _Distance(_First1, _Last1, _Count1);
+ _Diff2 _Count2 = 0;
+ _Distance(_First2, _Last2, _Count2);
+ _FwdIt1 _Ans = _Last1;
+
+ if (0 < _Count2)
+ for (; _Count2 <= _Count1; ++_First1, --_Count1)
+ { // room for match, try it
+ _FwdIt1 _Mid1 = _First1;
+ for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1)
+ if (!_Pred(*_Mid1, *_Mid2))
+ break;
+ else if (++_Mid2 == _Last2)
+ { // potential answer, save it
+ _Ans = _First1;
+ break;
+ }
+ }
+ return (_Ans);
+ }
+
+template inline
+ _FwdIt1 find_end(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred)
+ { // find last [_First2, _Last2) satisfying _Pred
+ return (_Find_end(_First1, _Last1, _First2, _Last2, _Pred,
+ _Dist_type(_First1), _Dist_type(_First2)));
+ }
+
+ // TEMPLATE FUNCTION find_first_of
+template inline
+ _FwdIt1 find_first_of(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2)
+ { // look for one of [_First2, _Last2) that matches element
+ for (; _First1 != _Last1; ++_First1)
+ for (_FwdIt2 _Mid2 = _First2; _Mid2 != _Last2; ++_Mid2)
+ if (*_First1 == *_Mid2)
+ return (_First1);
+ return (_First1);
+ }
+
+ // TEMPLATE FUNCTION find_first_of WITH PRED
+template inline
+ _FwdIt1 find_first_of(_FwdIt1 _First1, _FwdIt1 _Last1,
+ _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred)
+ { // look for one of [_First2, _Last2) satisfying _Pred with element
+ for (; _First1 != _Last1; ++_First1)
+ for (_FwdIt2 _Mid2 = _First2; _Mid2 != _Last2; ++_Mid2)
+ if (_Pred(*_First1, *_Mid2))
+ return (_First1);
+ return (_First1);
+ }
+
+ // TEMPLATE FUNCTION iter_swap
+template inline
+ void iter_swap(_FwdIt1 _Left, _FwdIt2 _Right)
+ { // swap *_Left and *_Right
+ std::swap(*_Left, *_Right);
+ }
+
+ // TEMPLATE FUNCTION swap_ranges
+template inline
+ _FwdIt2 swap_ranges(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2)
+ { // swap [_First1, _Last1) with [_First2, ...)
+ for (; _First1 != _Last1; ++_First1, ++_First2)
+ std::iter_swap(_First1, _First2);
+ return (_First2);
+ }
+
+ // TEMPLATE FUNCTION transform WITH UNARY OP
+template inline
+ _OutIt transform(_InIt _First, _InIt _Last, _OutIt _Dest, _Fn1 _Func)
+ { // transform [_First, _Last) with _Func
+ for (; _First != _Last; ++_First, ++_Dest)
+ *_Dest = _Func(*_First);
+ return (_Dest);
+ }
+
+ // TEMPLATE FUNCTION transform WITH BINARY OP
+template inline
+ _OutIt transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2,
+ _OutIt _Dest, _Fn2 _Func)
+ { // transform [_First1, _Last1) and [_First2, _Last2) with _Func
+ for (; _First1 != _Last1; ++_First1, ++_First2, ++_Dest)
+ *_Dest = _Func(*_First1, *_First2);
+ return (_Dest);
+ }
+
+ // TEMPLATE FUNCTION replace
+template inline
+ void replace(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Oldval, const _Ty& _Newval)
+ { // replace each matching _Oldval with _Newval
+ for (; _First != _Last; ++_First)
+ if (*_First == _Oldval)
+ *_First = _Newval;
+ }
+
+ // TEMPLATE FUNCTION replace_if
+template inline
+ void replace_if(_FwdIt _First, _FwdIt _Last, _Pr _Pred, const _Ty& _Val)
+ { // replace each satisfying _Pred with _Val
+ for (; _First != _Last; ++_First)
+ if (_Pred(*_First))
+ *_First = _Val;
+ }
+
+ // TEMPLATE FUNCTION replace_copy
+template inline
+ _OutIt replace_copy(_InIt _First, _InIt _Last, _OutIt _Dest,
+ const _Ty& _Oldval, const _Ty& _Newval)
+ { // copy replacing each matching _Oldval with _Newval
+ for (; _First != _Last; ++_First, ++_Dest)
+ *_Dest = *_First == _Oldval ? _Newval : *_First;
+ return (_Dest);
+ }
+
+ // TEMPLATE FUNCTION replace_copy_if
+template inline
+ _OutIt replace_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest,
+ _Pr _Pred, const _Ty& _Val)
+ { // copy replacing each satisfying _Pred with _Val
+ for (; _First != _Last; ++_First, ++_Dest)
+ *_Dest = _Pred(*_First) ? _Val : *_First;
+ return (_Dest);
+ }
+
+ // TEMPLATE FUNCTION generate
+template inline
+ void generate(_FwdIt _First, _FwdIt _Last, _Fn0 _Func)
+ { // replace [_First, _Last) with _Func()
+ for (; _First != _Last; ++_First)
+ *_First = _Func();
+ }
+
+ // TEMPLATE FUNCTION generate_n
+template inline
+ void generate_n(_OutIt _Dest, _Diff _Count, _Fn0 _Func)
+ { // replace [_Dest, _Dest + _Count) with _Func()
+ for (; 0 < _Count; --_Count, ++_Dest)
+ *_Dest = _Func();
+ }
+
+ // TEMPLATE FUNCTION remove_copy
+template inline
+ _OutIt remove_copy(_InIt _First, _InIt _Last,
+ _OutIt _Dest, const _Ty& _Val)
+ { // copy omitting each matching _Val
+ for (; _First != _Last; ++_First)
+ if (!(*_First == _Val))
+ *_Dest++ = *_First;
+ return (_Dest);
+ }
+
+ // TEMPLATE FUNCTION remove_copy_if
+template inline
+ _OutIt remove_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred)
+ { // copy omitting each element satisfying _Pred
+ for (; _First != _Last; ++_First)
+ if (!_Pred(*_First))
+ *_Dest++ = *_First;
+ return (_Dest);
+ }
+
+ // TEMPLATE FUNCTION remove
+template inline
+ _FwdIt remove(_FwdIt _First, _FwdIt _Last, const _Ty& _Val)
+ { // remove each matching _Val
+ _First = find(_First, _Last, _Val);
+ if (_First == _Last)
+ return (_First); // empty sequence, all done
+ else
+ { // nonempty sequence, worth doing
+ _FwdIt _First1 = _First;
+ return (std::remove_copy(++_First1, _Last, _First, _Val));
+ }
+ }
+
+ // TEMPLATE FUNCTION remove_if
+template inline
+ _FwdIt remove_if(_FwdIt _First, _FwdIt _Last, _Pr _Pred)
+ { // remove each satisfying _Pred
+ _First = std::find_if(_First, _Last, _Pred);
+ if (_First == _Last)
+ return (_First); // empty sequence, all done
+ else
+ { // nonempty sequence, worth doing
+ _FwdIt _First1 = _First;
+ return (std::remove_copy_if(++_First1, _Last, _First, _Pred));
+ }
+ }
+
+ // TEMPLATE FUNCTION unique
+template inline
+ _FwdIt unique(_FwdIt _First, _FwdIt _Last)
+ { // remove each matching previous
+ for (_FwdIt _Firstb; (_Firstb = _First) != _Last && ++_First != _Last; )
+ if (*_Firstb == *_First)
+ { // copy down
+ for (; ++_First != _Last; )
+ if (!(*_Firstb == *_First))
+ *++_Firstb = *_First;
+ return (++_Firstb);
+ }
+ return (_Last);
+ }
+
+ // TEMPLATE FUNCTION unique WITH PRED
+template inline
+ _FwdIt unique(_FwdIt _First, _FwdIt _Last, _Pr _Pred)
+ { // remove each satisfying _Pred with previous
+ for (_FwdIt _Firstb; (_Firstb = _First) != _Last && ++_First != _Last; )
+ if (_Pred(*_Firstb, *_First))
+ { // copy down
+ for (; ++_First != _Last; )
+ if (!_Pred(*_Firstb, *_First))
+ *++_Firstb = *_First;
+ return (++_Firstb);
+ }
+ return (_Last);
+ }
+
+ // TEMPLATE FUNCTION unique_copy
+template inline
+ _OutIt _Unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest, _Ty *)
+ { // copy compressing pairs that match, input iterators
+ _Ty _Val = *_First;
+
+ for (*_Dest++ = _Val; ++_First != _Last; )
+ if (!(_Val == *_First))
+ _Val = *_First, *_Dest++ = _Val;
+ return (_Dest);
+ }
+
+template inline
+ _OutIt _Unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest,
+ input_iterator_tag)
+ { // copy compressing pairs that match, input iterators
+ return (_Unique_copy(_First, _Last, _Dest, _Val_type(_First)));
+ }
+
+template inline
+ _OutIt _Unique_copy(_FwdIt _First, _FwdIt _Last, _OutIt _Dest,
+ forward_iterator_tag)
+ { // copy compressing pairs that match, forward iterators
+ _FwdIt _Firstb = _First;
+ for (*_Dest++ = *_Firstb; ++_First != _Last; )
+ if (!(*_Firstb == *_First))
+ _Firstb = _First, *_Dest++ = *_Firstb;
+ return (_Dest);
+ }
+
+template inline
+ _OutIt _Unique_copy(_BidIt _First, _BidIt _Last, _OutIt _Dest,
+ bidirectional_iterator_tag)
+ { // copy compressing pairs that match, bidirectional iterators
+ return (_Unique_copy(_First, _Last, _Dest, forward_iterator_tag()));
+ }
+
+template inline
+ _OutIt _Unique_copy(_RanIt _First, _RanIt _Last, _OutIt _Dest,
+ random_access_iterator_tag)
+ { // copy compressing pairs that match, random-access iterators
+ return (_Unique_copy(_First, _Last, _Dest, forward_iterator_tag()));
+ }
+
+template inline
+ _OutIt unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest)
+ { // copy compressing pairs that match
+ return (_First == _Last ? _Dest :
+ _Unique_copy(_First, _Last, _Dest, _Iter_cat(_First)));
+ }
+
+ // TEMPLATE FUNCTION unique_copy WITH PRED
+template inline
+ _OutIt _Unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred,
+ _Ty *)
+ { // copy compressing pairs satisfying _Pred, input iterators
+ _Ty _Val = *_First;
+
+ for (*_Dest++ = _Val; ++_First != _Last; )
+ if (!_Pred(_Val, *_First))
+ _Val = *_First, *_Dest++ = _Val;
+ return (_Dest);
+ }
+
+template inline
+ _OutIt _Unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred,
+ input_iterator_tag)
+ { // copy compressing pairs satisfying _Pred, input iterators
+ return (_Unique_copy(_First, _Last, _Dest, _Pred, _Val_type(_First)));
+ }
+
+template inline
+ _OutIt _Unique_copy(_FwdIt _First, _FwdIt _Last, _OutIt _Dest, _Pr _Pred,
+ forward_iterator_tag)
+ { // copy compressing pairs satisfying _Pred, forward iterators
+ _FwdIt _Firstb = _First;
+
+ for (*_Dest++ = *_Firstb; ++_First != _Last; )
+ if (!_Pred(*_Firstb, *_First))
+ _Firstb = _First, *_Dest++ = *_Firstb;
+ return (_Dest);
+ }
+
+template inline
+ _OutIt _Unique_copy(_BidIt _First, _BidIt _Last, _OutIt _Dest, _Pr _Pred,
+ bidirectional_iterator_tag)
+ { // copy compressing pairs satisfying _Pred, bidirectional iterators
+ return (_Unique_copy(_First, _Last, _Dest, _Pred,
+ forward_iterator_tag()));
+ }
+
+template inline
+ _OutIt _Unique_copy(_RanIt _First, _RanIt _Last, _OutIt _Dest, _Pr _Pred,
+ random_access_iterator_tag)
+ { // copy compressing pairs satisfying _Pred, random-access iterators
+ return (_Unique_copy(_First, _Last, _Dest, _Pred,
+ forward_iterator_tag()));
+ }
+
+template inline
+ _OutIt unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred)
+ { // copy compressing pairs satisfying _Pred
+ return (_First == _Last ? _Dest
+ : _Unique_copy(_First, _Last, _Dest, _Pred, _Iter_cat(_First)));
+ }
+
+ // TEMPLATE FUNCTION reverse
+template inline
+ void _Reverse(_BidIt _First, _BidIt _Last, bidirectional_iterator_tag)
+ { // reverse elements in [_First, _Last), bidirectional iterators
+ for (; _First != _Last && _First != --_Last; ++_First)
+ std::iter_swap(_First, _Last);
+ }
+
+template inline
+ void _Reverse(_RanIt _First, _RanIt _Last, random_access_iterator_tag)
+ { // reverse elements in [_First, _Last), random-access iterators
+ for (; _First < _Last; ++_First)
+ std::iter_swap(_First, --_Last);
+ }
+
+template inline
+ void reverse(_BidIt _First, _BidIt _Last)
+ { // reverse elements in [_First, _Last)
+ _Reverse(_First, _Last, _Iter_cat(_First));
+ }
+
+ // TEMPLATE FUNCTION reverse_copy
+template inline
+ _OutIt reverse_copy(_BidIt _First, _BidIt _Last, _OutIt _Dest)
+ { // copy reversing elements in [_First, _Last)
+ for (; _First != _Last; ++_Dest)
+ *_Dest = *--_Last;
+ return (_Dest);
+ }
+
+ // TEMPLATE FUNCTION rotate
+template inline
+ void _Rotate(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last,
+ forward_iterator_tag)
+ { // rotate [_First, _Last), forward iterators
+ for (_FwdIt _Next = _Mid; ; )
+ { // swap [_First, ...) into place
+ std::iter_swap(_First, _Next);
+ if (++_First == _Mid)
+ if (++_Next == _Last)
+ break; // done, quit
+ else
+ _Mid = _Next; // mark end of next interval
+ else if (++_Next == _Last)
+ _Next = _Mid; // wrap to last end
+ }
+ }
+
+template inline
+ void _Rotate(_BidIt _First, _BidIt _Mid, _BidIt _Last,
+ bidirectional_iterator_tag)
+ { // rotate [_First, _Last), bidirectional iterators
+ std::reverse(_First, _Mid);
+ std::reverse(_Mid, _Last);
+ std::reverse(_First, _Last);
+ }
+
+template inline
+ void _Rotate(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Diff *, _Ty *)
+ { // rotate [_First, _Last), random-access iterators
+ _Diff _Shift = _Mid - _First;
+ _Diff _Count = _Last - _First;
+
+ for (_Diff _Factor = _Shift; _Factor != 0; )
+ { // find subcycle count as GCD of shift count and length
+ _Diff _Tmp = _Count % _Factor;
+ _Count = _Factor, _Factor = _Tmp;
+ }
+
+ if (_Count < _Last - _First)
+ for (; 0 < _Count; --_Count)
+ { // rotate each subcycle
+ _RanIt _Hole = _First + _Count;
+ _RanIt _Next = _Hole;
+ _Ty _Holeval = *_Hole;
+ _RanIt _Next1 = _Next + _Shift == _Last ? _First : _Next + _Shift;
+ while (_Next1 != _Hole)
+ { // percolate elements back around subcycle
+ *_Next = *_Next1;
+ _Next = _Next1;
+ _Next1 = _Shift < _Last - _Next1 ? _Next1 + _Shift
+ : _First + (_Shift - (_Last - _Next1));
+ }
+ *_Next = _Holeval;
+ }
+ }
+
+template inline
+ void _Rotate(_RanIt _First, _RanIt _Mid, _RanIt _Last,
+ random_access_iterator_tag)
+ { // rotate [_First, _Last), random-access iterators
+ _Rotate(_First, _Mid, _Last, _Dist_type(_First), _Val_type(_First));
+ }
+
+template inline
+ void rotate(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last)
+ { // rotate [_First, _Last)
+ if (_First != _Mid && _Mid != _Last)
+ _Rotate(_First, _Mid, _Last, _Iter_cat(_First));
+ }
+
+ // TEMPLATE FUNCTION rotate_copy
+template inline
+ _OutIt rotate_copy(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last, _OutIt _Dest)
+ { // copy rotating [_First, _Last)
+ _Dest = std::copy(_Mid, _Last, _Dest);
+ return (std::copy(_First, _Mid, _Dest));
+ }
+
+ // TEMPLATE FUNCTION random_shuffle
+template inline
+ void _Random_shuffle(_RanIt _First, _RanIt _Last, _Diff *)
+ { // shuffle [_First, _Last)
+ const int _RANDOM_BITS = 15; // minimum random bits from rand()
+ const int _RANDOM_MAX = (1U << _RANDOM_BITS) - 1;
+
+ _RanIt _Next = _First;
+ for (unsigned long _Index = 2; ++_Next != _Last; ++_Index)
+ { // assume unsigned long big enough for _Diff count
+ unsigned long _Rm = _RANDOM_MAX;
+ unsigned long _Rn = ::rand() & _RANDOM_MAX;
+ for (; _Rm < _Index && _Rm != ~0UL;
+ _Rm = _Rm << _RANDOM_BITS | _RANDOM_MAX)
+ _Rn = _Rn << _RANDOM_BITS | _RANDOM_MAX; // build random value
+
+ std::iter_swap(_Next, _First + _Diff(_Rn % _Index)); // swap a pair
+ }
+ }
+
+template inline
+ void random_shuffle(_RanIt _First, _RanIt _Last)
+ { // shuffle [_First, _Last)
+ if (_First != _Last)
+ _Random_shuffle(_First, _Last, _Dist_type(_First));
+ }
+
+ // TEMPLATE FUNCTION random_shuffle WITH RANDOM FN
+template inline
+ void _Random_shuffle(_RanIt _First, _RanIt _Last, _Fn1& _Func, _Diff *)
+ { // shuffle nonempty [_First, _Last) using random function _Func
+ _RanIt _Next = _First;
+
+ for (_Diff _Index = 2; ++_Next != _Last; ++_Index)
+ std::iter_swap(_Next, _First + _Diff(_Func(_Index)));
+ }
+
+template inline
+ void random_shuffle(_RanIt _First, _RanIt _Last, _Fn1& _Func)
+ { // shuffle [_First, _Last) using random function _Func
+ if (_First != _Last)
+ _Random_shuffle(_First, _Last, _Func, _Dist_type(_First));
+ }
+
+ // TEMPLATE FUNCTION partition
+template inline
+ _BidIt partition(_BidIt _First, _BidIt _Last, _Pr _Pred)
+ { // move elements satisfying _Pred to beginning of sequence
+ for (; ; ++_First)
+ { // find any out-of-order pair
+ for (; _First != _Last && _Pred(*_First); ++_First)
+ ; // skip in-place elements at beginning
+ if (_First == _Last)
+ break; // done
+
+ for (; _First != --_Last && !_Pred(*_Last); )
+ ; // skip in-place elements at end
+ if (_First == _Last)
+ break; // done
+
+ std::iter_swap(_First, _Last); // swap out-of-place pair and loop
+ }
+ return (_First);
+ }
+
+ // TEMPLATE FUNCTION stable_partition
+template inline
+ _BidIt _Stable_partition(_BidIt _First, _BidIt _Last, _Pr _Pred,
+ _Diff _Count, _Temp_iterator<_Ty>& _Tempbuf)
+ { // partition preserving order of equivalents, using _Pred
+ if (_Count == 1)
+ return (_Pred(*_First) ? _Last : _First);
+ else if (_Count <= _Tempbuf._Maxlen())
+ { // temp buffer big enough, copy right partition out and back
+ _BidIt _Next = _First;
+ for (_Tempbuf._Init(); _First != _Last; ++_First)
+ if (_Pred(*_First))
+ *_Next++ = *_First;
+ else
+ *_Tempbuf++ = *_First;
+
+ std::copy(_Tempbuf._First(), _Tempbuf._Last(), _Next); // copy back
+ return (_Next);
+ }
+ else
+ { // temp buffer not big enough, divide and conquer
+ _BidIt _Mid = _First;
+ std::advance(_Mid, _Count / 2);
+
+ _BidIt _Left = _Stable_partition(_First, _Mid, _Pred,
+ _Count / 2, _Tempbuf); // form L1R1 in left half
+ _BidIt _Right = _Stable_partition(_Mid, _Last, _Pred,
+ _Count - _Count / 2, _Tempbuf); // form L2R2 in right half
+
+ _Diff _Count1 = 0;
+ _Distance(_Left, _Mid, _Count1);
+ _Diff _Count2 = 0;
+ _Distance(_Mid, _Right, _Count2);
+
+ return (_Buffered_rotate(_Left, _Mid, _Right,
+ _Count1, _Count2, _Tempbuf)); // rotate L1R1L2R2 to L1L2R1R2
+ }
+ }
+
+template inline
+ _BidIt _Stable_partition(_BidIt _First, _BidIt _Last, _Pr _Pred,
+ _Diff *, _Ty *)
+ { // partition preserving order of equivalents, using _Pred
+ _Diff _Count = 0;
+ _Distance(_First, _Last, _Count);
+ _Temp_iterator<_Ty> _Tempbuf(_Count);
+ return (_Stable_partition(_First, _Last, _Pred, _Count, _Tempbuf));
+ }
+
+template inline
+ _BidIt stable_partition(_BidIt _First, _BidIt _Last, _Pr _Pred)
+ { // partition preserving order of equivalents, using _Pred
+ return (_First == _Last ? _First : _Stable_partition(_First, _Last, _Pred,
+ _Dist_type(_First), _Val_type(_First)));
+ }
+
+ // TEMPLATE FUNCTION push_heap
+template inline
+ void _Push_heap(_RanIt _First, _Diff _Hole,
+ _Diff _Top, _Ty _Val)
+ { // percolate _Hole to _Top or where _Val belongs, using operator<
+ for (_Diff _Idx = (_Hole - 1) / 2;
+ _Top < _Hole && *(_First + _Idx) < _Val;
+ _Idx = (_Hole - 1) / 2)
+ { // move _Hole up to parent
+ *(_First + _Hole) = *(_First + _Idx);
+ _Hole = _Idx;
+ }
+
+ *(_First + _Hole) = _Val; // drop _Val into final hole
+ }
+
+template inline
+ void _Push_heap_0(_RanIt _First, _RanIt _Last, _Diff *, _Ty *)
+ { // push *_Last onto heap at [_First, _Last), using operator<
+ _Diff _Count = _Last - _First;
+ if (0 < _Count)
+ _Push_heap(_First, _Count, _Diff(0), _Ty(*_Last));
+ }
+
+template inline
+ void push_heap(_RanIt _First, _RanIt _Last)
+ { // push *(_Last - 1) onto heap at [_First, _Last - 1), using operator<
+ if (_First != _Last)
+ _Push_heap_0(_First, --_Last,
+ _Dist_type(_First), _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION push_heap WITH PRED
+template inline
+ void _Push_heap(_RanIt _First, _Diff _Hole,
+ _Diff _Top, _Ty _Val, _Pr _Pred)
+ { // percolate _Hole to _Top or where _Val belongs, using operator<
+ for (_Diff _Idx = (_Hole - 1) / 2;
+ _Top < _Hole && _Pred(*(_First + _Idx), _Val);
+ _Idx = (_Hole - 1) / 2)
+ { // move _Hole up to parent
+ *(_First + _Hole) = *(_First + _Idx);
+ _Hole = _Idx;
+ }
+
+ *(_First + _Hole) = _Val; // drop _Val into final hole
+ }
+
+template inline
+ void _Push_heap_0(_RanIt _First, _RanIt _Last, _Pr _Pred, _Diff *, _Ty *)
+ { // push *_Last onto heap at [_First, _Last), using _Pred
+ _Diff _Count = _Last - _First;
+ if (0 < _Count)
+ _Push_heap(_First, _Count, _Diff(0), _Ty(*_Last), _Pred);
+ }
+
+template inline
+ void push_heap(_RanIt _First, _RanIt _Last, _Pr _Pred)
+ { // push *(_Last - 1) onto heap at [_First, _Last - 1), using _Pred
+ if (_First != _Last)
+ _Push_heap_0(_First, --_Last, _Pred,
+ _Dist_type(_First), _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION pop_heap
+template inline
+ void _Adjust_heap(_RanIt _First, _Diff _Hole, _Diff _Bottom, _Ty _Val)
+ { // percolate _Hole to _Bottom, then push _Val, using operator<
+ _Diff _Top = _Hole;
+ _Diff _Idx = 2 * _Hole + 2;
+
+ for (; _Idx < _Bottom; _Idx = 2 * _Idx + 2)
+ { // move _Hole down to larger child
+ if (*(_First + _Idx) < *(_First + (_Idx - 1)))
+ --_Idx;
+ *(_First + _Hole) = *(_First + _Idx), _Hole = _Idx;
+ }
+
+ if (_Idx == _Bottom)
+ { // only child at bottom, move _Hole down to it
+ *(_First + _Hole) = *(_First + (_Bottom - 1));
+ _Hole = _Bottom - 1;
+ }
+ _Push_heap(_First, _Hole, _Top, _Val);
+ }
+
+template inline
+ void _Pop_heap(_RanIt _First, _RanIt _Last, _RanIt _Dest,
+ _Ty _Val, _Diff *)
+ { // pop *_First to *_Dest and reheap, using operator<
+ *_Dest = *_First;
+ _Adjust_heap(_First, _Diff(0), _Diff(_Last - _First), _Val);
+ }
+
+template inline
+ void _Pop_heap_0(_RanIt _First, _RanIt _Last, _Ty *)
+ { // pop *_First to *(_Last - 1) and reheap, using operator<
+ _Pop_heap(_First, _Last - 1, _Last - 1,
+ _Ty(*(_Last - 1)), _Dist_type(_First));
+ }
+
+template inline
+ void pop_heap(_RanIt _First, _RanIt _Last)
+ { // pop *_First to *(_Last - 1) and reheap, using operator<
+ if (1 < _Last - _First)
+ _Pop_heap_0(_First, _Last, _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION pop_heap WITH PRED
+template inline
+ void _Adjust_heap(_RanIt _First, _Diff _Hole, _Diff _Bottom,
+ _Ty _Val, _Pr _Pred)
+ { // percolate _Hole to _Bottom, then push _Val, using _Pred
+ _Diff _Top = _Hole;
+ _Diff _Idx = 2 * _Hole + 2;
+
+ for (; _Idx < _Bottom; _Idx = 2 * _Idx + 2)
+ { // move _Hole down to larger child
+ if (_Pred(*(_First + _Idx), *(_First + (_Idx - 1))))
+ --_Idx;
+ *(_First + _Hole) = *(_First + _Idx), _Hole = _Idx;
+ }
+
+ if (_Idx == _Bottom)
+ { // only child at bottom, move _Hole down to it
+ *(_First + _Hole) = *(_First + (_Bottom - 1));
+ _Hole = _Bottom - 1;
+ }
+ _Push_heap(_First, _Hole, _Top, _Val, _Pred);
+ }
+
+template inline
+ void _Pop_heap(_RanIt _First, _RanIt _Last, _RanIt _Dest,
+ _Ty _Val, _Pr _Pred, _Diff *)
+ { // pop *_First to *_Dest and reheap, using _Pred
+ *_Dest = *_First;
+ _Adjust_heap(_First, _Diff(0), _Diff(_Last - _First), _Val, _Pred);
+ }
+
+template inline
+ void _Pop_heap_0(_RanIt _First, _RanIt _Last, _Pr _Pred, _Ty *)
+ { // pop *_First to *(_Last - 1) and reheap, using _Pred
+ _Pop_heap(_First, _Last - 1, _Last - 1,
+ _Ty(*(_Last - 1)), _Pred, _Dist_type(_First));
+ }
+
+template inline
+ void pop_heap(_RanIt _First, _RanIt _Last, _Pr _Pred)
+ { // pop *_First to *(_Last - 1) and reheap, using _Pred
+ if (1 < _Last - _First)
+ _Pop_heap_0(_First, _Last, _Pred, _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION make_heap
+template inline
+ void _Make_heap(_RanIt _First, _RanIt _Last, _Diff *, _Ty *)
+ { // make nontrivial [_First, _Last) into a heap, using operator<
+ _Diff _Bottom = _Last - _First;
+
+ for (_Diff _Hole = _Bottom / 2; 0 < _Hole; )
+ { // reheap top half, bottom to top
+ --_Hole;
+ _Adjust_heap(_First, _Hole, _Bottom, _Ty(*(_First + _Hole)));
+ }
+ }
+
+template inline
+ void make_heap(_RanIt _First, _RanIt _Last)
+ { // make [_First, _Last) into a heap, using operator<
+ if (1 < _Last - _First)
+ _Make_heap(_First, _Last,
+ _Dist_type(_First), _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION make_heap WITH PRED
+template inline
+ void _Make_heap(_RanIt _First, _RanIt _Last, _Pr _Pred, _Diff *, _Ty *)
+ { // make nontrivial [_First, _Last) into a heap, using _Pred
+ _Diff _Bottom = _Last - _First;
+ for (_Diff _Hole = _Bottom / 2; 0 < _Hole; )
+ { // reheap top half, bottom to top
+ --_Hole;
+ _Adjust_heap(_First, _Hole, _Bottom,
+ _Ty(*(_First + _Hole)), _Pred);
+ }
+ }
+
+template inline
+ void make_heap(_RanIt _First, _RanIt _Last, _Pr _Pred)
+ { // make [_First, _Last) into a heap, using _Pred
+ if (1 < _Last - _First)
+ _Make_heap(_First, _Last, _Pred,
+ _Dist_type(_First), _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION sort_heap
+template inline
+ void sort_heap(_RanIt _First, _RanIt _Last)
+ { // order heap by repeatedly popping, using operator<
+ for (; 1 < _Last - _First; --_Last)
+ std::pop_heap(_First, _Last);
+ }
+
+ // TEMPLATE FUNCTION sort_heap WITH PRED
+template inline
+ void sort_heap(_RanIt _First, _RanIt _Last, _Pr _Pred)
+ { // order heap by repeatedly popping, using _Pred
+ for (; 1 < _Last - _First; --_Last)
+ std::pop_heap(_First, _Last, _Pred);
+ }
+
+ // TEMPLATE FUNCTION lower_bound
+template inline
+ _FwdIt _Lower_bound(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Diff *)
+ { // find first element not before _Val, using operator<
+ _Diff _Count = 0;
+ _Distance(_First, _Last, _Count);
+
+ for (; 0 < _Count; )
+ { // divide and conquer, find half that contains answer
+ _Diff _Count2 = _Count / 2;
+ _FwdIt _Mid = _First;
+ std::advance(_Mid, _Count2);
+
+ if (*_Mid < _Val)
+ _First = ++_Mid, _Count -= _Count2 + 1;
+ else
+ _Count = _Count2;
+ }
+ return (_First);
+ }
+
+template inline
+ _FwdIt lower_bound(_FwdIt _First, _FwdIt _Last, const _Ty& _Val)
+ { // find first element not before _Val, using operator<
+ return (_Lower_bound(_First, _Last, _Val, _Dist_type(_First)));
+ }
+
+ // TEMPLATE FUNCTION lower_bound WITH PRED
+template inline
+ _FwdIt _Lower_bound(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Val, _Pr _Pred, _Diff *)
+ { // find first element not before _Val, using _Pred
+ _Diff _Count = 0;
+ _Distance(_First, _Last, _Count);
+ for (; 0 < _Count; )
+ { // divide and conquer, find half that contains answer
+ _Diff _Count2 = _Count / 2;
+ _FwdIt _Mid = _First;
+ std::advance(_Mid, _Count2);
+
+ if (_Pred(*_Mid, _Val))
+ _First = ++_Mid, _Count -= _Count2 + 1;
+ else
+ _Count = _Count2;
+ }
+ return (_First);
+ }
+
+template inline
+ _FwdIt lower_bound(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Val, _Pr _Pred)
+ { // find first element not before _Val, using _Pred
+ return (_Lower_bound(_First, _Last, _Val, _Pred, _Dist_type(_First)));
+ }
+
+ // TEMPLATE FUNCTION upper_bound
+template inline
+ _FwdIt _Upper_bound(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Diff *)
+ { // find first element that _Val is before, using operator<
+ _Diff _Count = 0;
+ _Distance(_First, _Last, _Count);
+ for (; 0 < _Count; )
+ { // divide and conquer, find half that contains answer
+ _Diff _Count2 = _Count / 2;
+ _FwdIt _Mid = _First;
+ std::advance(_Mid, _Count2);
+
+ if (!(_Val < *_Mid))
+ _First = ++_Mid, _Count -= _Count2 + 1;
+ else
+ _Count = _Count2;
+ }
+ return (_First);
+ }
+
+template inline
+ _FwdIt upper_bound(_FwdIt _First, _FwdIt _Last, const _Ty& _Val)
+ { // find first element that _Val is before, using operator<
+ return (_Upper_bound(_First, _Last, _Val, _Dist_type(_First)));
+ }
+
+ // TEMPLATE FUNCTION upper_bound WITH PRED
+template inline
+ _FwdIt _Upper_bound(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Val, _Pr _Pred, _Diff *)
+ { // find first element that _Val is before, using _Pred
+ _Diff _Count = 0;
+ _Distance(_First, _Last, _Count);
+ for (; 0 < _Count; )
+ { // divide and conquer, find half that contains answer
+ _Diff _Count2 = _Count / 2;
+ _FwdIt _Mid = _First;
+ std::advance(_Mid, _Count2);
+
+ if (!_Pred(_Val, *_Mid))
+ _First = ++_Mid, _Count -= _Count2 + 1;
+ else
+ _Count = _Count2;
+ }
+ return (_First);
+ }
+
+template inline
+ _FwdIt upper_bound(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Val, _Pr _Pred)
+ { // find first element that _Val is before, using _Pred
+ return (_Upper_bound(_First, _Last, _Val, _Pred, _Dist_type(_First)));
+ }
+
+ // TEMPLATE FUNCTION equal_range
+template inline
+ pair<_FwdIt, _FwdIt> _Equal_range(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Val, _Diff *)
+ { // find range equivalent to _Val, using operator<
+ _Diff _Count = 0;
+ _Distance(_First, _Last, _Count);
+
+ for (; 0 < _Count; )
+ { // divide and conquer, check midpoint
+ _Diff _Count2 = _Count / 2;
+ _FwdIt _Mid = _First;
+ std::advance(_Mid, _Count2);
+
+ if (*_Mid < _Val)
+ { // range begins above _Mid, loop
+ _First = ++_Mid;
+ _Count -= _Count2 + 1;
+ }
+ else if (_Val < *_Mid)
+ _Count = _Count2; // range in first half, loop
+ else
+ { // range straddles mid, find each end and return
+ _FwdIt _First2 = lower_bound(_First, _Mid, _Val);
+ std::advance(_First, _Count);
+ _FwdIt _Last2 = upper_bound(++_Mid, _First, _Val);
+ return (pair<_FwdIt, _FwdIt>(_First2, _Last2));
+ }
+ }
+
+ return (pair<_FwdIt, _FwdIt>(_First, _First)); // empty range
+ }
+
+template inline
+ pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Val)
+ { // find range equivalent to _Val, using operator<
+ return (_Equal_range(_First, _Last, _Val, _Dist_type(_First)));
+ }
+
+ // TEMPLATE FUNCTION equal_range WITH PRED
+template inline
+ pair<_FwdIt, _FwdIt> _Equal_range(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Val, _Pr _Pred, _Diff *)
+ { // find range equivalent to _Val, using _Pred
+ _Diff _Count = 0;
+ _Distance(_First, _Last, _Count);
+
+ for (; 0 < _Count; )
+ { // divide and conquer, check midpoint
+ _Diff _Count2 = _Count / 2;
+ _FwdIt _Mid = _First;
+ std::advance(_Mid, _Count2);
+
+ if (_Pred(*_Mid, _Val))
+ { // range begins above _Mid, loop
+ _First = ++_Mid;
+ _Count -= _Count2 + 1;
+ }
+ else if (_Pred(_Val, *_Mid))
+ _Count = _Count2; // range in first half, loop
+ else
+ { // range straddles _Mid, find each end and return
+ _FwdIt _First2 = lower_bound(_First, _Mid, _Val, _Pred);
+ std::advance(_First, _Count);
+ _FwdIt _Last2 = upper_bound(++_Mid, _First, _Val, _Pred);
+ return (pair<_FwdIt, _FwdIt>(_First2, _Last2));
+ }
+ }
+
+ return (pair<_FwdIt, _FwdIt>(_First, _First)); // empty range
+ }
+
+template inline
+ pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Val, _Pr _Pred)
+ { // find range equivalent to _Val, using _Pred
+ return (_Equal_range(_First, _Last, _Val, _Pred, _Dist_type(_First)));
+ }
+
+ // TEMPLATE FUNCTION binary_search
+template inline
+ bool binary_search(_FwdIt _First, _FwdIt _Last, const _Ty& _Val)
+ { // test if _Val equivalent to some element, using operator<
+ _First = std::lower_bound(_First, _Last, _Val);
+ return (_First != _Last && !(_Val < *_First));
+ }
+
+ // TEMPLATE FUNCTION binary_search WITH PRED
+template inline
+ bool binary_search(_FwdIt _First, _FwdIt _Last,
+ const _Ty& _Val, _Pr _Pred)
+ { // test if _Val equivalent to some element, using _Pred
+ _First = std::lower_bound(_First, _Last, _Val, _Pred);
+ return (_First != _Last && !_Pred(_Val, *_First));
+ }
+
+ // TEMPLATE FUNCTION merge
+template inline
+ _OutIt merge(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest)
+ { // copy merging ranges, both using operator<
+ for (; _First1 != _Last1 && _First2 != _Last2; ++_Dest)
+ if (*_First2 < *_First1)
+ *_Dest = *_First2, ++_First2;
+ else
+ *_Dest = *_First1, ++_First1;
+
+ _Dest = std::copy(_First1, _Last1, _Dest); // copy any tail
+ return (std::copy(_First2, _Last2, _Dest));
+ }
+
+ // TEMPLATE FUNCTION merge WITH PRED
+template inline
+ _OutIt merge(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred)
+ { // copy merging ranges, both using _Pred
+ for (; _First1 != _Last1 && _First2 != _Last2; ++_Dest)
+ if (_Pred(*_First2, *_First1))
+ *_Dest = *_First2, ++_First2;
+ else
+ *_Dest = *_First1, ++_First1;
+
+ _Dest = std::copy(_First1, _Last1, _Dest); // copy any tail
+ return (std::copy(_First2, _Last2, _Dest));
+ }
+
+ // TEMPLATE FUNCTION inplace_merge
+template inline
+ _BidIt _Buffered_rotate(_BidIt _First, _BidIt _Mid, _BidIt _Last,
+ _Diff _Count1, _Diff _Count2, _Temp_iterator<_Ty>& _Tempbuf)
+ { // rotate [_First, _Last) using temp buffer
+ if (_Count1 <= _Count2 && _Count1 <= _Tempbuf._Maxlen())
+ { // buffer left partition, then copy parts
+ std::copy(_First, _Mid, _Tempbuf._Init());
+ std::copy(_Mid, _Last, _First);
+ return (std::copy_backward(_Tempbuf._First(), _Tempbuf._Last(),
+ _Last));
+ }
+ else if (_Count2 <= _Tempbuf._Maxlen())
+ { // buffer right partition, then copy parts
+ std::copy(_Mid, _Last, _Tempbuf._Init());
+ std::copy_backward(_First, _Mid, _Last);
+ return (std::copy(_Tempbuf._First(), _Tempbuf._Last(), _First));
+ }
+ else
+ { // buffer too small, rotate in place
+ std::rotate(_First, _Mid, _Last);
+ std::advance(_First, _Count2);
+ return (_First);
+ }
+ }
+
+template inline
+ _BidIt3 _Merge_backward(_BidIt1 _First1, _BidIt1 _Last1,
+ _BidIt2 _First2, _BidIt2 _Last2, _BidIt3 _Dest)
+ { // merge backwards to _Dest, using operator<
+ for (; ; )
+ if (_First1 == _Last1)
+ return (std::copy_backward(_First2, _Last2, _Dest));
+ else if (_First2 == _Last2)
+ return (std::copy_backward(_First1, _Last1, _Dest));
+ else if (*--_Last2 < *--_Last1)
+ *--_Dest = *_Last1, ++_Last2;
+ else
+ *--_Dest = *_Last2, ++_Last1;
+ }
+
+template inline
+ void _Buffered_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last,
+ _Diff _Count1, _Diff _Count2,
+ _Temp_iterator<_Ty>& _Tempbuf)
+ { // merge [_First, _Mid) with [_Mid, _Last), using operator<
+ if (_Count1 + _Count2 == 2)
+ { // order two one-element partitions
+ if (*_Mid < *_First)
+ std::iter_swap(_First, _Mid);
+ }
+ else if (_Count1 <= _Count2 && _Count1 <= _Tempbuf._Maxlen())
+ { // buffer left partition, then merge
+ std::copy(_First, _Mid, _Tempbuf._Init());
+ std::merge(_Tempbuf._First(), _Tempbuf._Last(), _Mid, _Last, _First);
+ }
+ else if (_Count2 <= _Tempbuf._Maxlen())
+ { // buffer right partition, then merge
+ std::copy(_Mid, _Last, _Tempbuf._Init());
+ _Merge_backward(_First, _Mid,
+ _Tempbuf._First(), _Tempbuf._Last(), _Last);
+ }
+ else
+ { // buffer too small, divide and conquer
+ _BidIt _Firstn, _Lastn;
+ _Diff _Count1n, _Count2n;
+
+ if (_Count2 < _Count1)
+ { // left larger, cut it in half and partition right to match
+ _Count1n = _Count1 / 2, _Count2n = 0;
+ _Firstn = _First;
+ std::advance(_Firstn, _Count1n);
+ _Lastn = std::lower_bound(_Mid, _Last, *_Firstn);
+ _Distance(_Mid, _Lastn, _Count2n);
+ }
+ else
+ { // right larger, cut it in half and partition left to match
+ _Count1n = 0, _Count2n = _Count2 / 2;
+ _Lastn = _Mid;
+ std::advance(_Lastn, _Count2n);
+ _Firstn = std::upper_bound(_First, _Mid, *_Lastn);
+ _Distance(_First, _Firstn, _Count1n);
+ }
+
+ _BidIt _Midn = _Buffered_rotate(_Firstn, _Mid, _Lastn,
+ _Count1 - _Count1n, _Count2n, _Tempbuf); // rearrange middle
+ _Buffered_merge(_First, _Firstn, _Midn,
+ _Count1n, _Count2n, _Tempbuf); // merge each new part
+ _Buffered_merge(_Midn, _Lastn, _Last,
+ _Count1 - _Count1n, _Count2 - _Count2n, _Tempbuf);
+ }
+ }
+
+template inline
+ void _Inplace_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last,
+ _Diff *, _Ty *)
+ { // merge [_First, _Mid) with [_Mid, _Last), using operator<
+ _Diff _Count1 = 0;
+ _Distance(_First, _Mid, _Count1);
+ _Diff _Count2 = 0;
+ _Distance(_Mid, _Last, _Count2);
+ _Temp_iterator<_Ty> _Tempbuf(_Count1 < _Count2 ? _Count1 : _Count2);
+ _Buffered_merge(_First, _Mid, _Last,
+ _Count1, _Count2, _Tempbuf);
+ }
+
+template inline
+ void inplace_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last)
+ { // merge [_First, _Mid) with [_Mid, _Last), using operator<
+ if (_First != _Mid && _Mid != _Last)
+ _Inplace_merge(_First, _Mid, _Last,
+ _Dist_type(_First), _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION inplace_merge WITH PRED
+template inline
+ _BidIt3 _Merge_backward(_BidIt1 _First1, _BidIt1 _Last1,
+ _BidIt2 _First2, _BidIt2 _Last2, _BidIt3 _Dest, _Pr _Pred)
+ { // merge backwards to _Dest, using _Pred
+ for (; ; )
+ if (_First1 == _Last1)
+ return (std::copy_backward(_First2, _Last2, _Dest));
+ else if (_First2 == _Last2)
+ return (std::copy_backward(_First1, _Last1, _Dest));
+ else if (_Pred(*--_Last2, *--_Last1))
+ *--_Dest = *_Last1, ++_Last2;
+ else
+ *--_Dest = *_Last2, ++_Last1;
+ }
+
+template inline
+ void _Buffered_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last,
+ _Diff _Count1, _Diff _Count2,
+ _Temp_iterator<_Ty>& _Tempbuf, _Pr _Pred)
+ { // merge [_First, _Mid) with [_Mid, _Last), using _Pred
+ if (_Count1 + _Count2 == 2)
+ { // order two one-element partitions
+ if (_Pred(*_Mid, *_First))
+ std::iter_swap(_First, _Mid);
+ }
+ else if (_Count1 <= _Count2 && _Count1 <= _Tempbuf._Maxlen())
+ { // buffer left partition, then merge
+ std::copy(_First, _Mid, _Tempbuf._Init());
+ std::merge(_Tempbuf._First(), _Tempbuf._Last(),
+ _Mid, _Last, _First, _Pred);
+ }
+ else if (_Count2 <= _Tempbuf._Maxlen())
+ { // buffer right partition, then merge
+ std::copy(_Mid, _Last, _Tempbuf._Init());
+ _Merge_backward(_First, _Mid, _Tempbuf._First(), _Tempbuf._Last(),
+ _Last, _Pred);
+ }
+ else
+ { // buffer too small, divide and conquer
+ _BidIt _Firstn, _Lastn;
+ _Diff _Count1n, _Count2n;
+ if (_Count2 < _Count1)
+ { // left larger, cut it in half and partition right to match
+ _Count1n = _Count1 / 2, _Count2n = 0;
+ _Firstn = _First;
+ std::advance(_Firstn, _Count1n);
+ _Lastn = lower_bound(_Mid, _Last, *_Firstn, _Pred);
+ _Distance(_Mid, _Lastn, _Count2n);
+ }
+ else
+ { // right larger, cut it in half and partition left to match
+ _Count1n = 0, _Count2n = _Count2 / 2;
+ _Lastn = _Mid;
+ std::advance(_Lastn, _Count2n);
+ _Firstn = upper_bound(_First, _Mid, *_Lastn, _Pred);
+ _Distance(_First, _Firstn, _Count1n);
+ }
+ _BidIt _Midn = _Buffered_rotate(_Firstn, _Mid, _Lastn,
+ _Count1 - _Count1n, _Count2n, _Tempbuf); // rearrange middle
+ _Buffered_merge(_First, _Firstn, _Midn,
+ _Count1n, _Count2n, _Tempbuf, _Pred); // merge each new part
+ _Buffered_merge(_Midn, _Lastn, _Last,
+ _Count1 - _Count1n, _Count2 - _Count2n, _Tempbuf, _Pred);
+ }
+ }
+
+template inline
+ void _Inplace_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last, _Pr _Pred,
+ _Diff *, _Ty *)
+ { // merge [_First, _Mid) with [_Mid, _Last), using _Pred
+ _Diff _Count1 = 0;
+ _Distance(_First, _Mid, _Count1);
+ _Diff _Count2 = 0;
+ _Distance(_Mid, _Last, _Count2);
+ _Temp_iterator<_Ty> _Tempbuf(_Count1 < _Count2 ? _Count1 : _Count2);
+ _Buffered_merge(_First, _Mid, _Last,
+ _Count1, _Count2, _Tempbuf, _Pred);
+ }
+
+template inline
+ void inplace_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last, _Pr _Pred)
+ { // merge [_First, _Mid) with [_Mid, _Last), using _Pred
+ if (_First != _Mid && _Mid != _Last)
+ _Inplace_merge(_First, _Mid, _Last, _Pred,
+ _Dist_type(_First), _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION sort
+template inline
+ void _Insertion_sort(_BidIt _First, _BidIt _Last)
+ { // insertion sort [_First, _Last), using operator<
+ if (_First != _Last)
+ for (_BidIt _Next = _First; ++_Next != _Last; )
+ if (*_Next < *_First)
+ { // found new earliest element, rotate to front
+ _BidIt _Next1 = _Next;
+ std::rotate(_First, _Next, ++_Next1);
+ }
+ else
+ { // look for insertion point after first
+ _BidIt _Dest = _Next;
+ for (_BidIt _Dest0 = _Dest; *_Next < *--_Dest0; )
+ _Dest = _Dest0;
+ if (_Dest != _Next)
+ { // rotate into place
+ _BidIt _Next1 = _Next;
+ std::rotate(_Dest, _Next, ++_Next1);
+ }
+ }
+ }
+
+template inline
+ void _Med3(_RanIt _First, _RanIt _Mid, _RanIt _Last)
+ { // sort median of three elements to middle
+ if (*_Mid < *_First)
+ std::iter_swap(_Mid, _First);
+ if (*_Last < *_Mid)
+ std::iter_swap(_Last, _Mid);
+ if (*_Mid < *_First)
+ std::iter_swap(_Mid, _First);
+ }
+
+template inline
+ void _Median(_RanIt _First, _RanIt _Mid, _RanIt _Last)
+ { // sort median element to middle
+ if (40 < _Last - _First)
+ { // median of nine
+ int _Step = (_Last - _First + 1) / 8;
+ _Med3(_First, _First + _Step, _First + 2 * _Step);
+ _Med3(_Mid - _Step, _Mid, _Mid + _Step);
+ _Med3(_Last - 2 * _Step, _Last - _Step, _Last);
+ _Med3(_First + _Step, _Mid, _Last - _Step);
+ }
+ else
+ _Med3(_First, _Mid, _Last);
+ }
+
+template inline
+ pair<_RanIt, _RanIt> _Unguarded_partition(_RanIt _First, _RanIt _Last)
+ { // partition [_First, _Last), using operator<
+ _RanIt _Mid = _First + (_Last - _First) / 2; // sort median to _Mid
+ _Median(_First, _Mid, _Last - 1);
+ _RanIt _Pfirst = _Mid;
+ _RanIt _Plast = _Pfirst + 1;
+
+ while (_First < _Pfirst
+ && !(*(_Pfirst - 1) < *_Pfirst)
+ && !(*_Pfirst < *(_Pfirst - 1)))
+ --_Pfirst;
+ while (_Plast < _Last
+ && !(*_Plast < *_Pfirst)
+ && !(*_Pfirst < *_Plast))
+ ++_Plast;
+
+ _RanIt _Gfirst = _Plast;
+ _RanIt _Glast = _Pfirst;
+
+ for (; ; )
+ { // partition
+ for (; _Gfirst < _Last; ++_Gfirst)
+ if (*_Pfirst < *_Gfirst)
+ ;
+ else if (*_Gfirst < *_Pfirst)
+ break;
+ else
+ std::iter_swap(_Plast++, _Gfirst);
+ for (; _First < _Glast; --_Glast)
+ if (*(_Glast - 1) < *_Pfirst)
+ ;
+ else if (*_Pfirst < *(_Glast - 1))
+ break;
+ else
+ std::iter_swap(--_Pfirst, _Glast - 1);
+ if (_Glast == _First && _Gfirst == _Last)
+ return (pair<_RanIt, _RanIt>(_Pfirst, _Plast));
+
+ if (_Glast == _First)
+ { // no room at bottom, rotate pivot upward
+ if (_Plast != _Gfirst)
+ std::iter_swap(_Pfirst, _Plast);
+ ++_Plast;
+ std::iter_swap(_Pfirst++, _Gfirst++);
+ }
+ else if (_Gfirst == _Last)
+ { // no room at top, rotate pivot downward
+ if (--_Glast != --_Pfirst)
+ std::iter_swap(_Glast, _Pfirst);
+ std::iter_swap(_Pfirst, --_Plast);
+ }
+ else
+ std::iter_swap(_Gfirst++, --_Glast);
+ }
+ }
+
+template inline
+ void _Sort(_RanIt _First, _RanIt _Last, _Diff _Ideal)
+ { // order [_First, _Last), using operator<
+ _Diff _Count;
+ for (; _ISORT_MAX < (_Count = _Last - _First) && 0 < _Ideal; )
+ { // divide and conquer by quicksort
+ pair<_RanIt, _RanIt> _Mid = _Unguarded_partition(_First, _Last);
+ _Ideal /= 2, _Ideal += _Ideal / 2; // allow 1.5 log2(N) divisions
+
+ if (_Mid.first - _First < _Last - _Mid.second) // loop on larger half
+ _Sort(_First, _Mid.first, _Ideal), _First = _Mid.second;
+ else
+ _Sort(_Mid.second, _Last, _Ideal), _Last = _Mid.first;
+ }
+
+ if (_ISORT_MAX < _Count)
+ { // heap sort if too many divisions
+ std::make_heap(_First, _Last);
+ std::sort_heap(_First, _Last);
+ }
+ else if (1 < _Count)
+ _Insertion_sort(_First, _Last); // small, insertion sort
+ }
+
+template inline
+ void sort(_RanIt _First, _RanIt _Last)
+ { // order [_First, _Last), using operator<
+ _Sort(_First, _Last, _Last - _First);
+ }
+
+ // TEMPLATE FUNCTION sort WITH PRED
+template inline
+ void _Insertion_sort(_BidIt _First, _BidIt _Last, _Pr _Pred)
+ { // insertion sort [_First, _Last), using _Pred
+ if (_First != _Last)
+ for (_BidIt _Next = _First; ++_Next != _Last; )
+ if (_Pred(*_Next, *_First))
+ { // found new earliest element, rotate to front
+ _BidIt _Next1 = _Next;
+ std::rotate(_First, _Next, ++_Next1);
+ }
+ else
+ { // look for insertion point after first
+ _BidIt _Dest = _Next;
+ for (_BidIt _Dest0 = _Dest; _Pred(*_Next, *--_Dest0); )
+ _Dest = _Dest0;
+ if (_Dest != _Next)
+ { // rotate into place
+ _BidIt _Next1 = _Next;
+ std::rotate(_Dest, _Next, ++_Next1);
+ }
+ }
+ }
+
+template inline
+ void _Med3(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pred)
+ { // sort median of three elements to middle
+ if (_Pred(*_Mid, *_First))
+ std::iter_swap(_Mid, _First);
+ if (_Pred(*_Last, *_Mid))
+ std::iter_swap(_Last, _Mid);
+ if (_Pred(*_Mid, *_First))
+ std::iter_swap(_Mid, _First);
+ }
+
+template inline
+ void _Median(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pred)
+ { // sort median element to middle
+ if (40 < _Last - _First)
+ { // median of nine
+ int _Step = (_Last - _First + 1) / 8;
+ _Med3(_First, _First + _Step, _First + 2 * _Step, _Pred);
+ _Med3(_Mid - _Step, _Mid, _Mid + _Step, _Pred);
+ _Med3(_Last - 2 * _Step, _Last - _Step, _Last, _Pred);
+ _Med3(_First + _Step, _Mid, _Last - _Step, _Pred);
+ }
+ else
+ _Med3(_First, _Mid, _Last, _Pred);
+ }
+
+template inline
+ pair<_RanIt, _RanIt> _Unguarded_partition(_RanIt _First, _RanIt _Last,
+ _Pr _Pred)
+ { // partition [_First, _Last), using _Pred
+ _RanIt _Mid = _First + (_Last - _First) / 2;
+ _Median(_First, _Mid, _Last - 1, _Pred);
+ _RanIt _Pfirst = _Mid;
+ _RanIt _Plast = _Pfirst + 1;
+
+ while (_First < _Pfirst
+ && !_Pred(*(_Pfirst - 1), *_Pfirst)
+ && !_Pred(*_Pfirst, *(_Pfirst - 1)))
+ --_Pfirst;
+ while (_Plast < _Last
+ && !_Pred(*_Plast, *_Pfirst)
+ && !_Pred(*_Pfirst, *_Plast))
+ ++_Plast;
+
+ _RanIt _Gfirst = _Plast;
+ _RanIt _Glast = _Pfirst;
+
+ for (; ; )
+ { // partition
+ for (; _Gfirst < _Last; ++_Gfirst)
+ if (_Pred(*_Pfirst, *_Gfirst))
+ ;
+ else if (_Pred(*_Gfirst, *_Pfirst))
+ break;
+ else
+ std::iter_swap(_Plast++, _Gfirst);
+ for (; _First < _Glast; --_Glast)
+ if (_Pred(*(_Glast - 1), *_Pfirst))
+ ;
+ else if (_Pred(*_Pfirst, *(_Glast - 1)))
+ break;
+ else
+ std::iter_swap(--_Pfirst, _Glast - 1);
+ if (_Glast == _First && _Gfirst == _Last)
+ return (pair<_RanIt, _RanIt>(_Pfirst, _Plast));
+
+ if (_Glast == _First)
+ { // no room at bottom, rotate pivot upward
+ if (_Plast != _Gfirst)
+ std::iter_swap(_Pfirst, _Plast);
+ ++_Plast;
+ std::iter_swap(_Pfirst++, _Gfirst++);
+ }
+ else if (_Gfirst == _Last)
+ { // no room at top, rotate pivot downward
+ if (--_Glast != --_Pfirst)
+ std::iter_swap(_Glast, _Pfirst);
+ std::iter_swap(_Pfirst, --_Plast);
+ }
+ else
+ std::iter_swap(_Gfirst++, --_Glast);
+ }
+ }
+
+template inline
+ void _Sort(_RanIt _First, _RanIt _Last, _Diff _Ideal, _Pr _Pred)
+ { // order [_First, _Last), using _Pred
+ _Diff _Count;
+ for (; _ISORT_MAX < (_Count = _Last - _First) && 0 < _Ideal; )
+ { // divide and conquer by quicksort
+ pair<_RanIt, _RanIt> _Mid =
+ _Unguarded_partition(_First, _Last, _Pred);
+ _Ideal /= 2, _Ideal += _Ideal / 2; // allow 1.5 log2(N) divisions
+
+ if (_Mid.first - _First < _Last - _Mid.second) // loop on larger half
+ _Sort(_First, _Mid.first, _Ideal, _Pred), _First = _Mid.second;
+ else
+ _Sort(_Mid.second, _Last, _Ideal, _Pred), _Last = _Mid.first;
+ }
+
+ if (_ISORT_MAX < _Count)
+ { // heap sort if too many divisions
+ std::make_heap(_First, _Last, _Pred);
+ std::sort_heap(_First, _Last, _Pred);
+ }
+ else if (1 < _Count)
+ _Insertion_sort(_First, _Last, _Pred); // small, insertion sort
+ }
+
+template inline
+ void sort(_RanIt _First, _RanIt _Last, _Pr _Pred)
+ { // order [_First, _Last), using _Pred
+ _Sort(_First, _Last, _Last - _First, _Pred);
+ }
+
+ // TEMPLATE FUNCTION stable_sort
+template inline
+ void _Chunked_merge(_BidIt _First, _BidIt _Last, _OutIt _Dest,
+ _Diff _Chunk, _Diff _Count)
+ { // copy merging chunks, using operator<
+ for (_Diff _Chunk2 = _Chunk * 2; _Chunk2 <= _Count; _Count -= _Chunk2)
+ { // copy merging pairs of adjacent chunks
+ _BidIt _Mid1 = _First;
+ std::advance(_Mid1, _Chunk);
+ _BidIt _Mid2 = _Mid1;
+ std::advance(_Mid2, _Chunk);
+
+ _Dest = std::merge(_First, _Mid1, _Mid1, _Mid2, _Dest);
+ _First = _Mid2;
+ }
+
+ if (_Count <= _Chunk)
+ std::copy(_First, _Last, _Dest); // copy partial last chunk
+ else
+ { // copy merging whole and partial last chunk
+ _BidIt _Mid = _First;
+ std::advance(_Mid, _Chunk);
+
+ std::merge(_First, _Mid, _Mid, _Last, _Dest);
+ }
+ }
+
+template inline
+ void _Buffered_merge_sort(_BidIt _First, _BidIt _Last, _Diff _Count,
+ _Temp_iterator<_Ty>& _Tempbuf)
+ { // sort using temp buffer for merges, using operator<
+ _BidIt _Mid = _First;
+ for (_Diff _Nleft = _Count; _ISORT_MAX <= _Nleft; _Nleft -= _ISORT_MAX)
+ { // sort chunks
+ _BidIt _Midend = _Mid;
+ std::advance(_Midend, (int)_ISORT_MAX);
+
+ _Insertion_sort(_Mid, _Midend);
+ _Mid = _Midend;
+ }
+ _Insertion_sort(_Mid, _Last); // sort partial last chunk
+
+ for (_Diff _Chunk = _ISORT_MAX; _Chunk < _Count; _Chunk *= 2)
+ { // merge adjacent pairs of chunks to and from temp buffer
+ _Chunked_merge(_First, _Last, _Tempbuf._Init(),
+ _Chunk, _Count);
+ _Chunked_merge(_Tempbuf._First(), _Tempbuf._Last(), _First,
+ _Chunk *= 2, _Count);
+ }
+ }
+
+template inline
+ void _Stable_sort(_BidIt _First, _BidIt _Last, _Diff _Count,
+ _Temp_iterator<_Ty>& _Tempbuf)
+ { // sort preserving order of equivalents, using operator<
+ if (_Count <= _ISORT_MAX)
+ _Insertion_sort(_First, _Last); // small, insertion sort
+ else
+ { // sort halves and merge
+ _Diff _Count2 = (_Count + 1) / 2;
+ _BidIt _Mid = _First;
+ std::advance(_Mid, _Count2);
+
+ if (_Count2 <= _Tempbuf._Maxlen())
+ { // temp buffer big enough, sort each half using buffer
+ _Buffered_merge_sort(_First, _Mid, _Count2, _Tempbuf);
+ _Buffered_merge_sort(_Mid, _Last, _Count - _Count2, _Tempbuf);
+ }
+ else
+ { // temp buffer not big enough, divide and conquer
+ _Stable_sort(_First, _Mid, _Count2, _Tempbuf);
+ _Stable_sort(_Mid, _Last, _Count - _Count2, _Tempbuf);
+ }
+
+ _Buffered_merge(_First, _Mid, _Last,
+ _Count2, _Count - _Count2, _Tempbuf); // merge sorted halves
+ }
+ }
+
+template inline
+ void _Stable_sort(_BidIt _First, _BidIt _Last, _Diff *, _Ty *)
+ { // sort preserving order of equivalents, using operator<
+ _Diff _Count = 0;
+ _Distance(_First, _Last, _Count);
+ _Temp_iterator<_Ty> _Tempbuf(_Count);
+ _Stable_sort(_First, _Last, _Count, _Tempbuf);
+ }
+
+template inline
+ void stable_sort(_BidIt _First, _BidIt _Last)
+ { // sort preserving order of equivalents, using operator<
+ if (_First != _Last)
+ _Stable_sort(_First, _Last, _Dist_type(_First), _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION stable_sort WITH PRED
+template inline
+ void _Chunked_merge(_BidIt _First, _BidIt _Last, _OutIt _Dest,
+ _Diff _Chunk, _Diff _Count, _Pr _Pred)
+ { // copy merging chunks, using _Pred
+ for (_Diff _Chunk2 = _Chunk * 2; _Chunk2 <= _Count; _Count -= _Chunk2)
+ { // copy merging pairs of adjacent chunks
+ _BidIt _Mid1 = _First;
+ std::advance(_Mid1, _Chunk);
+ _BidIt _Mid2 = _Mid1;
+ std::advance(_Mid2, _Chunk);
+
+ _Dest = std::merge(_First, _Mid1, _Mid1, _Mid2, _Dest, _Pred);
+ _First = _Mid2;
+ }
+
+ if (_Count <= _Chunk)
+ std::copy(_First, _Last, _Dest); // copy partial last chunk
+ else
+ { // copy merging whole and partial last chunk
+ _BidIt _Mid1 = _First;
+ std::advance(_Mid1, _Chunk);
+
+ std::merge(_First, _Mid1, _Mid1, _Last, _Dest, _Pred);
+ }
+ }
+
+template inline
+ void _Buffered_merge_sort(_BidIt _First, _BidIt _Last, _Diff _Count,
+ _Temp_iterator<_Ty>& _Tempbuf, _Pr _Pred)
+ { // sort using temp buffer for merges, using _Pred
+ _BidIt _Mid = _First;
+ for (_Diff _Nleft = _Count; _ISORT_MAX <= _Nleft; _Nleft -= _ISORT_MAX)
+ { // sort chunks
+ _BidIt _Midn = _Mid;
+ std::advance(_Midn, (int)_ISORT_MAX);
+
+ _Insertion_sort(_Mid, _Midn, _Pred);
+ _Mid = _Midn;
+ }
+ _Insertion_sort(_Mid, _Last, _Pred); // sort partial last chunk
+
+ for (_Diff _Chunk = _ISORT_MAX; _Chunk < _Count; _Chunk *= 2)
+ { // merge adjacent pairs of chunks to and from temp buffer
+ _Chunked_merge(_First, _Last, _Tempbuf._Init(),
+ _Chunk, _Count, _Pred);
+ _Chunked_merge(_Tempbuf._First(), _Tempbuf._Last(), _First,
+ _Chunk *= 2, _Count, _Pred);
+ }
+ }
+
+template inline
+ void _Stable_sort(_BidIt _First, _BidIt _Last, _Diff _Count,
+ _Temp_iterator<_Ty>& _Tempbuf, _Pr _Pred)
+ { // sort preserving order of equivalents, using _Pred
+ if (_Count <= _ISORT_MAX)
+ _Insertion_sort(_First, _Last, _Pred); // small, insertion sort
+ else
+ { // sort halves and merge
+ _Diff _Count2 = (_Count + 1) / 2;
+ _BidIt _Mid = _First;
+ std::advance(_Mid, _Count2);
+
+ if (_Count2 <= _Tempbuf._Maxlen())
+ { // temp buffer big enough, sort each half using buffer
+ _Buffered_merge_sort(_First, _Mid, _Count2, _Tempbuf, _Pred);
+ _Buffered_merge_sort(_Mid, _Last, _Count - _Count2,
+ _Tempbuf, _Pred);
+ }
+ else
+ { // temp buffer not big enough, divide and conquer
+ _Stable_sort(_First, _Mid, _Count2, _Tempbuf, _Pred);
+ _Stable_sort(_Mid, _Last, _Count - _Count2, _Tempbuf, _Pred);
+ }
+
+ _Buffered_merge(_First, _Mid, _Last,
+ _Count2, _Count - _Count2, _Tempbuf, _Pred); // merge halves
+ }
+ }
+
+template inline
+ void _Stable_sort(_BidIt _First, _BidIt _Last, _Diff *, _Ty *, _Pr _Pred)
+ { // sort preserving order of equivalents, using _Pred
+ _Diff _Count = 0;
+ _Distance(_First, _Last, _Count);
+ _Temp_iterator<_Ty> _Tempbuf(_Count);
+ _Stable_sort(_First, _Last, _Count, _Tempbuf, _Pred);
+ }
+
+template inline
+ void stable_sort(_BidIt _First, _BidIt _Last, _Pr _Pred)
+ { // sort preserving order of equivalents, using _Pred
+ if (_First != _Last)
+ _Stable_sort(_First, _Last,
+ _Dist_type(_First), _Val_type(_First), _Pred);
+ }
+
+ // TEMPLATE FUNCTION partial_sort
+template inline
+ void _Partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Ty *)
+ { // order [First, _Last) up to _Mid, using operator<
+ std::make_heap(_First, _Mid);
+
+ for (_RanIt _Next = _Mid; _Next < _Last; ++_Next)
+ if (*_Next < *_First)
+ _Pop_heap(_First, _Mid, _Next, _Ty(*_Next),
+ _Dist_type(_First)); // replace top with new largest
+ std::sort_heap(_First, _Mid);
+ }
+
+template inline
+ void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last)
+ { // order [First, _Last) up to _Mid, using operator<
+ _Partial_sort(_First, _Mid, _Last, _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION partial_sort WITH PRED
+template inline
+ void _Partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last,
+ _Pr _Pred, _Ty *)
+ { // order [First, _Last) up to _Mid, using _Pred
+ std::make_heap(_First, _Mid, _Pred);
+
+ for (_RanIt _Next = _Mid; _Next < _Last; ++_Next)
+ if (_Pred(*_Next, *_First))
+ _Pop_heap(_First, _Mid, _Next, _Ty(*_Next), _Pred,
+ _Dist_type(_First)); // replace top with new largest
+ std::sort_heap(_First, _Mid, _Pred);
+ }
+
+template inline
+ void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pred)
+ { // order [First, _Last) up to _Mid, using _Pred
+ _Partial_sort(_First, _Mid, _Last, _Pred, _Val_type(_First));
+ }
+
+ // TEMPLATE FUNCTION partial_sort_copy
+template inline
+ _RanIt _Partial_sort_copy(_InIt _First1, _InIt _Last1,
+ _RanIt _First2, _RanIt _Last2, _Diff *, _Ty *)
+ { // copy [First1, _Last1) into [_First2, _Last2), using operator<
+ _RanIt _Mid2 = _First2;
+ for (; _First1 != _Last1 && _Mid2 != _Last2; ++_First1, ++_Mid2)
+ *_Mid2 = *_First1; // copy min(_Last1 - _First1, _Last2 - _First2)
+ std::make_heap(_First2, _Mid2);
+
+ for (; _First1 != _Last1; ++_First1)
+ if (*_First1 < *_First2)
+ _Adjust_heap(_First2, _Diff(0), _Diff(_Mid2 - _First2),
+ _Ty(*_First1)); // replace top with new largest
+
+ std::sort_heap(_First2, _Mid2);
+ return (_Mid2);
+ }
+
+template inline
+ _RanIt partial_sort_copy(_InIt _First1, _InIt _Last1,
+ _RanIt _First2, _RanIt _Last2)
+ { // copy [First1, _Last1) into [_First2, _Last2), using operator<
+ return (_First1 == _Last1 || _First2 == _Last2 ? _First2
+ : _Partial_sort_copy(_First1, _Last1, _First2, _Last2,
+ _Dist_type(_First2), _Val_type(_First1)));
+ }
+
+ // TEMPLATE FUNCTION partial_sort_copy WITH PRED
+template inline
+ _RanIt _Partial_sort_copy(_InIt _First1, _InIt _Last1,
+ _RanIt _First2, _RanIt _Last2, _Pr _Pred, _Diff *, _Ty *)
+ { // copy [First1, _Last1) into [_First2, _Last2) using _Pred
+ _RanIt _Mid2 = _First2;
+ for (; _First1 != _Last1 && _Mid2 != _Last2; ++_First1, ++_Mid2)
+ *_Mid2 = *_First1; // copy min(_Last1 - _First1, _Last2 - _First2)
+ std::make_heap(_First2, _Mid2, _Pred);
+
+ for (; _First1 != _Last1; ++_First1)
+ if (_Pred(*_First1, *_First2))
+ _Adjust_heap(_First2, _Diff(0), _Diff(_Mid2 - _First2),
+ _Ty(*_First1), _Pred); // replace top with new largest
+
+ std::sort_heap(_First2, _Mid2, _Pred);
+ return (_Mid2);
+ }
+
+template inline
+ _RanIt partial_sort_copy(_InIt _First1, _InIt _Last1,
+ _RanIt _First2, _RanIt _Last2, _Pr _Pred)
+ { // copy [First1, _Last1) into [_First2, _Last2) using _Pred
+ return (_First1 == _Last1 || _First2 == _Last2 ? _First2
+ : _Partial_sort_copy(_First1, _Last1, _First2, _Last2, _Pred,
+ _Dist_type(_First2), _Val_type(_First1)));
+ }
+
+ // TEMPLATE FUNCTION nth_element
+template inline
+ void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last)
+ { // order Nth element, using operator<
+ for (; _ISORT_MAX < _Last - _First; )
+ { // divide and conquer, ordering partition containing Nth
+ pair<_RanIt, _RanIt> _Mid =
+ _Unguarded_partition(_First, _Last);
+
+ if (_Mid.second <= _Nth)
+ _First = _Mid.second;
+ else if (_Mid.first <= _Nth)
+ return; // Nth inside fat pivot, done
+ else
+ _Last = _Mid.first;
+ }
+
+ _Insertion_sort(_First, _Last); // sort any remainder
+ }
+
+ // TEMPLATE FUNCTION nth_element WITH PRED
+template inline
+ void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last, _Pr _Pred)
+ { // order Nth element, using _Pred
+ for (; _ISORT_MAX < _Last - _First; )
+ { // divide and conquer, ordering partition containing Nth
+ pair<_RanIt, _RanIt> _Mid =
+ _Unguarded_partition(_First, _Last, _Pred);
+
+ if (_Mid.second <= _Nth)
+ _First = _Mid.second;
+ else if (_Mid.first <= _Nth)
+ return; // Nth inside fat pivot, done
+ else
+ _Last = _Mid.first;
+ }
+
+ _Insertion_sort(_First, _Last, _Pred); // sort any remainder
+ }
+
+ // TEMPLATE FUNCTION includes
+template inline
+ bool includes(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2)
+ { // test if all [_First1, _Last1) in [_First2, _Last2), using operator<
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (*_First2 < *_First1)
+ return (false);
+ else if (*_First1 < *_First2)
+ ++_First1;
+ else
+ ++_First1, ++_First2;
+ return (_First2 == _Last2);
+ }
+
+ // TEMPLATE FUNCTION includes WITH PRED
+template inline
+ bool includes(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _Pr _Pred)
+ { // test if set [_First1, _Last1) in [_First2, _Last2), using _Pred
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (_Pred(*_First2, *_First1))
+ return (false);
+ else if (_Pred(*_First1, *_First2))
+ ++_First1;
+ else
+ ++_First1, ++_First2;
+ return (_First2 == _Last2);
+ }
+
+ // TEMPLATE FUNCTION set_union
+template inline
+ _OutIt set_union(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest)
+ { // OR sets [_First1, _Last1) and [_First2, _Last2), using operator<
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (*_First1 < *_First2)
+ *_Dest++ = *_First1, ++_First1;
+ else if (*_First2 < *_First1)
+ *_Dest++ = *_First2, ++_First2;
+ else
+ *_Dest++ = *_First1, ++_First1, ++_First2;
+ _Dest = std::copy(_First1, _Last1, _Dest);
+ return (std::copy(_First2, _Last2, _Dest));
+ }
+
+ // TEMPLATE FUNCTION set_union WITH PRED
+template inline
+ _OutIt set_union(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred)
+ { // OR sets [_First1, _Last1) and [_First2, _Last2), using _Pred
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (_Pred(*_First1, *_First2))
+ *_Dest++ = *_First1, ++_First1;
+ else if (_Pred(*_First2, *_First1))
+ *_Dest++ = *_First2, ++_First2;
+ else
+ *_Dest++ = *_First1, ++_First1, ++_First2;
+ _Dest = std::copy(_First1, _Last1, _Dest);
+ return (std::copy(_First2, _Last2, _Dest));
+ }
+
+ // TEMPLATE FUNCTION set_intersection
+template inline
+ _OutIt set_intersection(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest)
+ { // AND sets [_First1, _Last1) and [_First2, _Last2), using operator<
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (*_First1 < *_First2)
+ ++_First1;
+ else if (*_First2 < *_First1)
+ ++_First2;
+ else
+ *_Dest++ = *_First1++, ++_First2;
+ return (_Dest);
+ }
+
+ // TEMPLATE FUNCTION set_intersection WITH PRED
+template inline
+ _OutIt set_intersection(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred)
+ { // AND sets [_First1, _Last1) and [_First2, _Last2), using _Pred
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (_Pred(*_First1, *_First2))
+ ++_First1;
+ else if (_Pred(*_First2, *_First1))
+ ++_First2;
+ else
+ *_Dest++ = *_First1++, ++_First2;
+ return (_Dest);
+ }
+
+ // TEMPLATE FUNCTION set_difference
+template inline
+ _OutIt set_difference(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest)
+ { // take set [_First2, _Last2) from [_First1, _Last1), using operator<
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (*_First1 < *_First2)
+ *_Dest++ = *_First1, ++_First1;
+ else if (*_First2 < *_First1)
+ ++_First2;
+ else
+ ++_First1, ++_First2;
+ return (std::copy(_First1, _Last1, _Dest));
+ }
+
+ // TEMPLATE FUNCTION set_difference WITH PRED
+template inline
+ _OutIt set_difference(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred)
+ { // take set [_First2, _Last2) from [_First1, _Last1), using _Pred
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (_Pred(*_First1, *_First2))
+ *_Dest++ = *_First1, ++_First1;
+ else if (_Pred(*_First2, *_First1))
+ ++_First2;
+ else
+ ++_First1, ++_First2;
+ return (std::copy(_First1, _Last1, _Dest));
+ }
+
+ // TEMPLATE FUNCTION set_symmetric_difference
+template inline
+ _OutIt set_symmetric_difference(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest)
+ { // XOR sets [_First1, _Last1) and [_First2, _Last2), using operator<
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (*_First1 < *_First2)
+ *_Dest++ = *_First1, ++_First1;
+ else if (*_First2 < *_First1)
+ *_Dest++ = *_First2, ++_First2;
+ else
+ ++_First1, ++_First2;
+ _Dest = std::copy(_First1, _Last1, _Dest);
+ return (std::copy(_First2, _Last2, _Dest));
+ }
+
+ // TEMPLATE FUNCTION set_symmetric_difference WITH PRED
+template inline
+ _OutIt set_symmetric_difference(_InIt1 _First1, _InIt1 _Last1,
+ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred)
+ { // XOR sets [_First1, _Last1) and [_First2, _Last2), using _Pred
+ for (; _First1 != _Last1 && _First2 != _Last2; )
+ if (_Pred(*_First1, *_First2))
+ *_Dest++ = *_First1, ++_First1;
+ else if (_Pred(*_First2, *_First1))
+ *_Dest++ = *_First2, ++_First2;
+ else
+ ++_First1, ++_First2;
+ _Dest = std::copy(_First1, _Last1, _Dest);
+ return (std::copy(_First2, _Last2, _Dest));
+ }
+
+ // TEMPLATE FUNCTION max_element
+template inline
+ _FwdIt max_element(_FwdIt _First, _FwdIt _Last)
+ { // find largest element, using operator<
+ _FwdIt _Found = _First;
+ if (_First != _Last)
+ for (; ++_First != _Last; )
+ if (*_Found < *_First)
+ _Found = _First;
+ return (_Found);
+ }
+
+ // TEMPLATE FUNCTION max_element WITH PRED
+template inline
+ _FwdIt max_element(_FwdIt _First, _FwdIt _Last, _Pr _Pred)
+ { // find largest element, using _Pred
+ _FwdIt _Found = _First;
+ if (_First != _Last)
+ for (; ++_First != _Last; )
+ if (_Pred(*_Found, *_First))
+ _Found = _First;
+ return (_Found);
+ }
+
+ // TEMPLATE FUNCTION min_element
+template inline
+ _FwdIt min_element(_FwdIt _First, _FwdIt _Last)
+ { // find smallest element, using operator<
+ _FwdIt _Found = _First;
+ if (_First != _Last)
+ for (; ++_First != _Last; )
+ if (*_First < *_Found)
+ _Found = _First;
+ return (_Found);
+ }
+
+ // TEMPLATE FUNCTION min_element WITH PRED
+template inline
+ _FwdIt min_element(_FwdIt _First, _FwdIt _Last, _Pr _Pred)
+ { // find smallest element, using _Pred
+ _FwdIt _Found = _First;
+ if (_First != _Last)
+ for (; ++_First != _Last; )
+ if (_Pred(*_First, *_Found))
+ _Found = _First;
+ return (_Found);
+ }
+
+ // TEMPLATE FUNCTION next_permutation
+template inline
+ bool next_permutation(_BidIt _First, _BidIt _Last)
+ { // permute and test for pure ascending, using operator<
+ _BidIt _Next = _Last;
+ if (_First == _Last || _First == --_Next)
+ return (false);
+
+ for (; ; )
+ { // find rightmost element smaller than successor
+ _BidIt _Next1 = _Next;
+ if (*--_Next < *_Next1)
+ { // swap with rightmost element that's smaller, flip suffix
+ _BidIt _Mid = _Last;
+ for (; !(*_Next < *--_Mid); )
+ ;
+ std::iter_swap(_Next, _Mid);
+ std::reverse(_Next1, _Last);
+ return (true);
+ }
+
+ if (_Next == _First)
+ { // pure descending, flip all
+ std::reverse(_First, _Last);
+ return (false);
+ }
+ }
+ }
+
+ // TEMPLATE FUNCTION next_permutation WITH PRED
+template inline
+ bool next_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred)
+ { // permute and test for pure ascending, using _Pred
+ _BidIt _Next = _Last;
+ if (_First == _Last || _First == --_Next)
+ return (false);
+
+ for (; ; )
+ { // find rightmost element smaller than successor
+ _BidIt _Next1 = _Next;
+ if (_Pred(*--_Next, *_Next1))
+ { // swap with rightmost element that's smaller, flip suffix
+ _BidIt _Mid = _Last;
+ for (; !_Pred(*_Next, *--_Mid); )
+ ;
+ std::iter_swap(_Next, _Mid);
+ std::reverse(_Next1, _Last);
+ return (true);
+ }
+
+ if (_Next == _First)
+ { // pure descending, flip all
+ std::reverse(_First, _Last);
+ return (false);
+ }
+ }
+ }
+
+ // TEMPLATE FUNCTION prev_permutation
+template inline
+ bool prev_permutation(_BidIt _First, _BidIt _Last)
+ { // reverse permute and test for pure descending, using operator<
+ _BidIt _Next = _Last;
+ if (_First == _Last || _First == --_Next)
+ return (false);
+ for (; ; )
+ { // find rightmost element not smaller than successor
+ _BidIt _Next1 = _Next;
+ if (!(*--_Next < *_Next1))
+ { // swap with rightmost element that's not smaller, flip suffix
+ _BidIt _Mid = _Last;
+ for (; *_Next < *--_Mid; )
+ ;
+ std::iter_swap(_Next, _Mid);
+ std::reverse(_Next1, _Last);
+ return (true);
+ }
+
+ if (_Next == _First)
+ { // pure ascending, flip all
+ std::reverse(_First, _Last);
+ return (false);
+ }
+ }
+ }
+
+ // TEMPLATE FUNCTION prev_permutation WITH PRED
+template inline
+ bool prev_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred)
+ { // reverse permute and test for pure descending, using _Pred
+ _BidIt _Next = _Last;
+ if (_First == _Last || _First == --_Next)
+ return (false);
+
+ for (; ; )
+ { // find rightmost element not smaller than successor
+ _BidIt _Next1 = _Next;
+ if (!_Pred(*--_Next, *_Next1))
+ { // swap with rightmost element that's not smaller, flip suffix
+ _BidIt _Mid = _Last;
+ for (; _Pred(*_Next, *--_Mid); )
+ ;
+ std::iter_swap(_Next, _Mid);
+ std::reverse(_Next1, _Last);
+ return (true);
+ }
+
+ if (_Next == _First)
+ { // pure ascending, flip all
+ std::reverse(_First, _Last);
+ return (false);
+ }
+ }
+ }
+_STD_END
+
+ #pragma warning(default: 4244)
+
+#pragma warning(pop)
+#pragma pack(pop)
+
+#endif /* _ALGORITHM_ */
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ */
+
+/*
+ * This file is derived from software bearing the following
+ * restrictions:
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this
+ * software and its documentation for any purpose is hereby
+ * granted without fee, provided that the above copyright notice
+ * appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation.
+ * Hewlett-Packard Company makes no representations about the
+ * suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/assert.h b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/assert.h
new file mode 100644
index 00000000..a122efbe
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/assert.h
@@ -0,0 +1,58 @@
+/***
+*assert.h - define the assert macro
+*
+* Copyright (c) Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* Defines the assert(exp) macro.
+* [ANSI/System V]
+*
+* [Public]
+*
+****/
+
+#if !defined(_WIN32)
+#error ERROR: Only Win32 target supported!
+#endif
+
+
+
+
+/* Define _CRTIMP */
+
+#ifndef _CRTIMP
+#ifdef _DLL
+#define _CRTIMP __declspec(dllimport)
+#else /* ndef _DLL */
+#define _CRTIMP
+#endif /* _DLL */
+#endif /* _CRTIMP */
+
+
+/* Define __cdecl for non-Microsoft compilers */
+
+#if ( !defined(_MSC_VER) && !defined(__cdecl) )
+#define __cdecl
+#endif
+
+#undef assert
+
+#ifdef NDEBUG
+
+#define assert(exp) ((void)0)
+
+#else
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_CRTIMP void __cdecl _assert(const char *, const char *, unsigned);
+
+#ifdef __cplusplus
+}
+#endif
+
+#define assert(exp) (void)( (exp) || (_assert(#exp, __FILE__, __LINE__), 0) )
+
+#endif /* NDEBUG */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/bitset b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/bitset
new file mode 100644
index 00000000..e5e00f3f
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/bitset
@@ -0,0 +1,481 @@
+// bitset standard header
+#pragma once
+#ifndef _BITSET_
+#define _BITSET_
+#include
+
+#pragma pack(push,8)
+#pragma warning(push,3)
+
+ #pragma warning(disable: 4127)
+
+
+
+_STD_BEGIN
+
+ // TEMPLATE CLASS bitset
+template
+ class bitset
+ { // store fixed-length sequence of Boolean elements
+ typedef unsigned long _Ty; // base type for a storage word
+
+public:
+ typedef bool element_type; // retained
+
+ // CLASS reference
+ class reference
+ { // proxy for an element
+ friend class bitset<_Bits>;
+
+ public:
+ reference& operator=(bool _Val)
+ { // assign Boolean to element
+ _Pbitset->set(_Mypos, _Val);
+ return (*this);
+ }
+
+ reference& operator=(const reference& _Bitref)
+ { // assign reference to element
+ _Pbitset->set(_Mypos, bool(_Bitref));
+ return (*this);
+ }
+
+ reference& flip()
+ { // complement stored element
+ _Pbitset->flip(_Mypos);
+ return (*this);
+ }
+
+ bool operator~() const
+ { // return complemented element
+ return (!_Pbitset->test(_Mypos));
+ }
+
+ operator bool() const
+ { // return element
+ return (_Pbitset->test(_Mypos));
+ }
+
+ private:
+ reference(bitset<_Bits>& _Bitset, size_t _Pos)
+ : _Pbitset(&_Bitset), _Mypos(_Pos)
+ { // construct from bitset reference and position
+ }
+
+ bitset<_Bits> *_Pbitset; // pointer to the bitset
+ size_t _Mypos; // position of element in bitset
+ };
+
+ bool at(size_t _Pos) const // retained
+ { // subscript nonmutable sequence with checking
+ if (_Bits <= _Pos)
+ _Xran();
+ return (test(_Pos));
+ }
+
+ reference at(size_t _Pos) // retained
+ { // subscript mutable sequence with checking
+ if (_Bits <= _Pos)
+ _Xran();
+ return (reference(*this, _Pos));
+ }
+
+ bool operator[](size_t _Pos) const
+ { // subscript nonmutable sequence
+ return (test(_Pos));
+ }
+
+ reference operator[](size_t _Pos)
+ { // subscript mutable sequence
+ return (reference(*this, _Pos));
+ }
+
+ bitset()
+ { // construct with all false values
+ _Tidy();
+ }
+
+ bitset(unsigned long _Val)
+ { // construct from bits in unsigned long
+ _Tidy();
+ for (size_t _Pos = 0; _Val != 0 && _Pos < _Bits; _Val >>= 1, ++_Pos)
+ if (_Val & 1)
+ set(_Pos);
+ }
+
+ #define _BITSET_SIZE_TYPE \
+ typename basic_string<_Elem, _Tr, _Alloc>::size_type
+
+ template
+ explicit bitset(const basic_string<_Elem, _Tr, _Alloc>& _Str,
+ _BITSET_SIZE_TYPE _Pos = 0)
+ { // construct from [_Pos, ...) elements in string
+ _Construct(_Str, _Pos, basic_string<_Elem, _Tr, _Alloc>::npos);
+ }
+
+ template
+ explicit bitset(const basic_string<_Elem, _Tr, _Alloc>& _Str,
+ _BITSET_SIZE_TYPE _Pos,
+ _BITSET_SIZE_TYPE _Count)
+ { // construct from [_Pos, _Pos + _Count) elements in string
+ _Construct(_Str, _Pos, _Count);
+ }
+
+ template
+ void _Construct(
+ const basic_string<_Elem, _Tr, _Alloc>& _Str,
+ _BITSET_SIZE_TYPE _Pos,
+ _BITSET_SIZE_TYPE _Count)
+ { // initialize from [_Pos, _Pos + _Count) elements in string
+ typename basic_string<_Elem, _Tr, _Alloc>::size_type _Num;
+ if (_Str.size() < _Pos)
+ _Xran(); // _Pos off end
+ if (_Str.size() - _Pos < _Count)
+ _Count = _Str.size() - _Pos; // trim _Count to size
+ if (_Bits < _Count)
+ _Count = _Bits; // trim _Count to length of bitset
+ _Tidy();
+
+ for (_Pos += _Count, _Num = 0; _Num < _Count; ++_Num)
+ if (_Str[--_Pos] == '1')
+ set(_Num);
+ else if (_Str[_Pos] != '0')
+ _Xinv();
+ }
+
+ bitset<_Bits>& operator&=(const bitset<_Bits>& _Right)
+ { // AND in _Right
+ for (int _Wpos = _Words; 0 <= _Wpos; --_Wpos)
+ _Array[_Wpos] &= _Right._Getword(_Wpos);
+ return (*this);
+ }
+
+ bitset<_Bits>& operator|=(const bitset<_Bits>& _Right)
+ { // OR in _Right
+ for (int _Wpos = _Words; 0 <= _Wpos; --_Wpos)
+ _Array[_Wpos] |= _Right._Getword(_Wpos);
+ return (*this);
+ }
+
+ bitset<_Bits>& operator^=(const bitset<_Bits>& _Right)
+ { // XOR in _Right
+ for (int _Wpos = _Words; 0 <= _Wpos; --_Wpos)
+ _Array[_Wpos] ^= _Right._Getword(_Wpos);
+ return (*this);
+ }
+
+ bitset<_Bits>& operator<<=(size_t _Pos)
+ { // shift left by _Pos
+ const int _Wordshift = _Pos / _Bitsperword;
+ if (_Wordshift != 0)
+ for (int _Wpos = _Words; 0 <= _Wpos; --_Wpos) // shift by words
+ _Array[_Wpos] = _Wordshift <= _Wpos
+ ? _Array[_Wpos - _Wordshift] : (_Ty)0;
+
+ if ((_Pos %= _Bitsperword) != 0)
+ { // 0 < _Pos < _Bitsperword, shift by bits
+ for (int _Wpos = _Words; 0 < _Wpos; --_Wpos)
+ _Array[_Wpos] = (_Ty)((_Array[_Wpos] << _Pos)
+ | (_Array[_Wpos - 1] >> (_Bitsperword - _Pos)));
+ _Array[0] <<= _Pos;
+ _Trim();
+ }
+ return (*this);
+ }
+
+ bitset<_Bits>& operator>>=(size_t _Pos)
+ { // shift right by _Pos
+ const int _Wordshift = _Pos / _Bitsperword;
+ if (_Wordshift != 0)
+ for (int _Wpos = 0; _Wpos <= _Words; ++_Wpos) // shift by words
+ _Array[_Wpos] = _Wordshift <= _Words - _Wpos
+ ? _Array[_Wpos + _Wordshift] : (_Ty)0;
+
+ if ((_Pos %= _Bitsperword) != 0)
+ { // 0 < _Pos < _Bitsperword, shift by bits
+ for (int _Wpos = 0; _Wpos < _Words; ++_Wpos)
+ _Array[_Wpos] = (_Ty)((_Array[_Wpos] >> _Pos)
+ | (_Array[_Wpos + 1] << (_Bitsperword - _Pos)));
+ _Array[_Words] >>= _Pos;
+ }
+ return (*this);
+ }
+
+ bitset<_Bits>& set()
+ { // set all bits true
+ _Tidy((_Ty)~0);
+ return (*this);
+ }
+
+ bitset<_Bits>& set(size_t _Pos,
+ bool _Val = true)
+ { // set bit at _Pos to _Val
+ if (_Bits <= _Pos)
+ _Xran(); // _Pos off end
+ if (_Val)
+ _Array[_Pos / _Bitsperword] |= (_Ty)1 << _Pos % _Bitsperword;
+ else
+ _Array[_Pos / _Bitsperword] &= ~((_Ty)1 << _Pos % _Bitsperword);
+ return (*this);
+ }
+
+ bitset<_Bits>& reset()
+ { // set all bits false
+ _Tidy();
+ return (*this);
+ }
+
+ bitset<_Bits>& reset(size_t _Pos)
+ { // set bit at _Pos to false
+ return (set(_Pos, false));
+ }
+
+ bitset<_Bits> operator~() const
+ { // flip all bits
+ return (bitset<_Bits>(*this).flip());
+ }
+
+ bitset<_Bits>& flip()
+ { // flip all bits
+ for (int _Wpos = _Words; 0 <= _Wpos; --_Wpos)
+ _Array[_Wpos] = (_Ty)~_Array[_Wpos];
+
+ _Trim();
+ return (*this);
+ }
+
+ bitset<_Bits>& flip(size_t _Pos)
+ { // flip bit at _Pos
+ if (_Bits <= _Pos)
+ _Xran(); // _Pos off end
+ _Array[_Pos / _Bitsperword] ^= (_Ty)1 << _Pos % _Bitsperword;
+ return (*this);
+ }
+
+ unsigned long to_ulong() const
+ { // convert bitset to unsigned long
+ enum
+ { // cause zero divide if unsigned long not multiple of _Ty
+ _Assertion = 1
+ / (int)(sizeof (unsigned long) % sizeof (_Ty) == 0)};
+
+ int _Wpos = _Words;
+ for (; sizeof (unsigned long) / sizeof (_Ty) <= _Wpos; --_Wpos)
+ if (_Array[_Wpos] != 0)
+ _Xoflo(); // fail if any high-order words are nonzero
+
+ unsigned long _Val = _Array[_Wpos];
+ for (; 0 <= --_Wpos; )
+ _Val = _Val << _Bitsperword | _Array[_Wpos];
+ return (_Val);
+ }
+
+ template
+ basic_string<_Elem, _Tr, _Alloc> to_string() const
+ { // convert bitset to string
+ basic_string<_Elem, _Tr, _Alloc> _Str;
+ typename basic_string<_Elem, _Tr, _Alloc>::size_type _Pos;
+ _Str.reserve(_Bits);
+
+ for (_Pos = _Bits; 0 < _Pos; )
+ _Str += (char)('0' + (int)test(--_Pos));
+ return (_Str);
+ }
+
+ size_t count() const
+ { // count number of set bits
+ static char _Bitsperhex[] = "\0\1\1\2\1\2\2\3\1\2\2\3\2\3\3\4";
+ size_t _Val = 0;
+ for (int _Wpos = _Words; 0 <= _Wpos; --_Wpos)
+ for (_Ty _Wordval = _Array[_Wpos]; _Wordval != 0; _Wordval >>= 4)
+ _Val += _Bitsperhex[_Wordval & 0xF];
+ return (_Val);
+ }
+
+ size_t size() const
+ { // return size of bitset
+ return (_Bits);
+ }
+
+ bool operator==(const bitset<_Bits>& _Right) const
+ { // test for bitset equality
+ for (int _Wpos = _Words; 0 <= _Wpos; --_Wpos)
+ if (_Array[_Wpos] != _Right._Getword(_Wpos))
+ return (false);
+ return (true);
+ }
+
+ bool operator!=(const bitset<_Bits>& _Right) const
+ { // test for bitset inequality
+ return (!(*this == _Right));
+ }
+
+ bool test(size_t _Pos) const
+ { // test if bit at _Pos is set
+ if (_Bits <= _Pos)
+ _Xran(); // _Pos off end
+ return ((_Array[_Pos / _Bitsperword]
+ & ((_Ty)1 << _Pos % _Bitsperword)) != 0);
+ }
+
+ bool any() const
+ { // test if any bits are set
+ for (int _Wpos = _Words; 0 <= _Wpos; --_Wpos)
+ if (_Array[_Wpos] != 0)
+ return (true);
+ return (false);
+ }
+
+ bool none() const
+ { // test if no bits are set
+ return (!any());
+ }
+
+ bitset<_Bits> operator<<(size_t _Pos) const
+ { // return bitset shifted left by _Pos
+ return (bitset<_Bits>(*this) <<= _Pos);
+ }
+
+ bitset<_Bits> operator>>(size_t _Pos) const
+ { // return bitset shifted right by _Pos
+ return (bitset<_Bits>(*this) >>= _Pos);
+ }
+
+ bitset<_Bits> operator&(const bitset<_Bits>& _Right) const
+ { // return bitset AND _Right
+ return (bitset<_Bits>(*this) &= _Right);
+ }
+
+ bitset<_Bits> operator|(const bitset<_Bits>& _Right) const
+ { // return bitset OR _Right
+ return (bitset<_Bits>(*this) |= _Right);
+ }
+
+ bitset<_Bits> operator^(const bitset<_Bits>& _Right) const
+ { // return bitset XOR _Right
+ return (bitset<_Bits>(*this) ^= _Right);
+ }
+
+ _Ty _Getword(size_t _Wpos) const
+ { // get word at _Wpos
+ return (_Array[_Wpos]);
+ }
+
+private:
+ enum
+ { // parameters for packing bits into words
+ _Bitsperword = CHAR_BIT * sizeof (_Ty), // bits in each word
+ _Words = _Bits == 0
+ ? 0 : (_Bits - 1) / _Bitsperword}; // NB: number of words - 1
+
+ void _Tidy(_Ty _Wordval = 0)
+ { // set all words to _Wordval
+ for (int _Wpos = _Words; 0 <= _Wpos; --_Wpos)
+ _Array[_Wpos] = _Wordval;
+ if (_Wordval != 0)
+ _Trim();
+ }
+
+ void _Trim()
+ { // clear any trailing bits in last word
+ if (_Bits % _Bitsperword != 0)
+ _Array[_Words] &= ((_Ty)1 << _Bits % _Bitsperword) - 1;
+ }
+
+ void _Xinv() const
+ { // report invalid string element in bitset conversion
+ _THROW(invalid_argument, "invalid bitset char");
+ }
+
+ void _Xoflo() const
+ { // report converted value too big to represent
+ _THROW(overflow_error, "bitset overflow");
+ }
+
+ void _Xran() const
+ { // report bit index out of range
+ _THROW(out_of_range, "invalid bitset position");
+ }
+
+ _Ty _Array[_Words + 1]; // the set of bits
+ };
+
+ // TEMPLATE operator<<
+template inline
+ basic_ostream<_Elem, _Tr>& operator<<(
+ basic_ostream<_Elem, _Tr>& _Ostr, const bitset<_Bits>& _Right)
+ { // insert bitset as a string
+ return (_Ostr
+ << _Right.template to_string<_Elem, _Tr, allocator<_Elem> >());
+ }
+
+ // TEMPLATE operator>>
+template inline
+ basic_istream<_Elem, _Tr>& operator>>(
+ basic_istream<_Elem, _Tr>& _Istr, bitset<_Bits>& _Right)
+ { // extract bitset as a string
+ const ctype<_Elem>& _Ctype_fac = _USE(_Istr.getloc(), ctype<_Elem>);
+ const _Elem _E0 = _Ctype_fac.widen('0');
+ ios_base::iostate _State = ios_base::goodbit;
+ bool _Changed = false;
+ string _Str;
+ const typename basic_istream<_Elem, _Tr>::sentry _Ok(_Istr);
+
+ if (_Ok)
+ { // valid stream, extract elements
+ _TRY_IO_BEGIN
+ typename _Tr::int_type _Meta = _Istr.rdbuf()->sgetc();
+ for (size_t _Count = _Right.size(); 0 < _Count;
+ _Meta = _Istr.rdbuf()->snextc(), --_Count)
+ { // test _Meta
+ _Elem _Char;
+ if (_Tr::eq_int_type(_Tr::eof(), _Meta))
+ { // end of file, quit
+ _State |= ios_base::eofbit;
+ break;
+ }
+ else if ((_Char = _Tr::to_char_type(_Meta))
+ != _E0 && _Char != _E0 + 1)
+ break; // invalid element
+ else if (_Str.max_size() <= _Str.size())
+ { // no room in string, give up (unlikely)
+ _State |= ios_base::failbit;
+ break;
+ }
+ else
+ _Str.append(1, (_Char - _E0) + '0'), _Changed = true;
+ }
+ _CATCH_IO_(_Istr)
+ }
+
+ if (!_Changed)
+ _State |= ios_base::failbit;
+ _Istr.setstate(_State);
+ _Right = bitset<_Bits>(_Str); // convert string and store
+ return (_Istr);
+ }
+_STD_END
+
+ #pragma warning(default: 4127)
+
+#pragma warning(pop)
+#pragma pack(pop)
+
+#endif /* _BITSET */
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cassert b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cassert
new file mode 100644
index 00000000..244e31f7
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cassert
@@ -0,0 +1,8 @@
+// cassert standard header
+#include
+#include
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cctype b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cctype
new file mode 100644
index 00000000..8818d0f1
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cctype
@@ -0,0 +1,31 @@
+// cctype standard header
+#pragma once
+#ifndef _CCTYPE_
+#define _CCTYPE_
+#include
+
+#ifdef _STD_USING
+ #undef _STD_USING
+ #include
+ #define _STD_USING
+
+#else /* _STD_USING */
+ #include
+
+ #if _GLOBAL_USING
+_STD_BEGIN
+using ::isalnum; using ::isalpha; using ::iscntrl;
+using ::isdigit; using ::isgraph; using ::islower;
+using ::isprint; using ::ispunct; using ::isspace;
+using ::isupper; using ::isxdigit; using ::tolower;
+using ::toupper;
+_STD_END
+ #endif /* _GLOBAL_USING */
+
+#endif /* _STD_USING */
+#endif /* _CCTYPE_ */
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cerrno b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cerrno
new file mode 100644
index 00000000..e84e841c
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cerrno
@@ -0,0 +1,30 @@
+// cerrno standard header
+#pragma once
+#ifndef _CERRNO_
+#define _CERRNO_
+#include
+
+#ifdef _STD_USING
+ #undef _STD_USING
+ #include
+ #define _STD_USING
+
+#else /* _STD_USING */
+ #include
+
+ #if _GLOBAL_USING
+_STD_BEGIN
+ #ifndef errno
+using ::errno;
+ #endif /* errno */
+
+_STD_END
+ #endif /* _GLOBAL_USING */
+
+#endif /* _CERRNO_ */
+#endif /* _STD_USING */
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cfloat b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cfloat
new file mode 100644
index 00000000..f6f50f0d
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cfloat
@@ -0,0 +1,13 @@
+// cfloat standard header
+#pragma once
+#ifndef _CFLOAT_
+#define _CFLOAT_
+#include
+
+#include
+#endif /* _CFLOAT_ */
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/ciso646 b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/ciso646
new file mode 100644
index 00000000..0a1de626
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/ciso646
@@ -0,0 +1,13 @@
+// ciso646 standard header
+#pragma once
+#ifndef _CISO646_
+#define _CISO646_
+#include
+
+#include
+#endif /* _CISO646_ */
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/climits b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/climits
new file mode 100644
index 00000000..0f1ce63b
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/climits
@@ -0,0 +1,15 @@
+// climits standard header
+#pragma once
+#ifndef _CLIMITS_
+#define _CLIMITS_
+#include
+
+ #pragma warning(disable: 4514)
+
+#include
+#endif /* _CLIMITS_ */
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/clocale b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/clocale
new file mode 100644
index 00000000..b00137d8
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/clocale
@@ -0,0 +1,27 @@
+// clocale standard header
+#pragma once
+#ifndef _CLOCALE_
+#define _CLOCALE_
+#include
+
+#ifdef _STD_USING
+ #undef _STD_USING
+ #include
+ #define _STD_USING
+
+#else /* _STD_USING */
+ #include
+
+ #if _GLOBAL_USING
+_STD_BEGIN
+using ::lconv; using ::localeconv; using ::setlocale;
+_STD_END
+ #endif /* _GLOBAL_USING */
+
+#endif /* _STD_USING */
+#endif /* _CLOCALE_ */
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cmath b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cmath
new file mode 100644
index 00000000..35242c84
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/cmath
@@ -0,0 +1,52 @@
+// cmath standard header
+#pragma once
+#ifndef _CMATH_
+#define _CMATH_
+#include
+
+#ifdef _STD_USING
+ #undef _STD_USING
+ #include
+ #define _STD_USING
+
+#else /* _STD_USING */
+ #include
+
+ #if _GLOBAL_USING
+_STD_BEGIN
+using ::abs; using ::acos; using ::asin;
+using ::atan; using ::atan2; using ::ceil;
+using ::cos; using ::cosh; using ::exp;
+using ::fabs; using ::floor; using ::fmod;
+using ::frexp; using ::ldexp; using ::log;
+using ::log10; using ::modf; using ::pow;
+using ::sin; using ::sinh; using ::sqrt;
+using ::tan; using ::tanh;
+
+using ::acosf; using ::asinf;
+using ::atanf; using ::atan2f; using ::ceilf;
+using ::cosf; using ::coshf; using ::expf;
+using ::fabsf; using ::floorf; using ::fmodf;
+using ::frexpf; using ::ldexpf; using ::logf;
+using ::log10f; using ::modff; using ::powf;
+using ::sinf; using ::sinhf; using ::sqrtf;
+using ::tanf; using ::tanhf;
+
+using ::acosl; using ::asinl;
+using ::atanl; using ::atan2l; using ::ceill;
+using ::cosl; using ::coshl; using ::expl;
+using ::fabsl; using ::floorl; using ::fmodl;
+using ::frexpl; using ::ldexpl; using ::logl;
+using ::log10l; using ::modfl; using ::powl;
+using ::sinl; using ::sinhl; using ::sqrtl;
+using ::tanl; using ::tanhl;
+_STD_END
+ #endif /* _GLOBAL_USING */
+
+#endif /* _STD_USING */
+#endif /* _CMATH_ */
+
+/*
+ * Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
+ * Consult your license regarding permissions and restrictions.
+ V3.13:0009 */
diff --git a/windows_libs/Microsoft Visual C++ Toolkit 2003/include/complex b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/complex
new file mode 100644
index 00000000..cecc5985
--- /dev/null
+++ b/windows_libs/Microsoft Visual C++ Toolkit 2003/include/complex
@@ -0,0 +1,1170 @@
+// complex standard header
+#pragma once
+#ifndef _COMPLEX_
+#define _COMPLEX_
+#include
+#include
+#include
+
+#pragma pack(push,8)
+#pragma warning(push,3)
+
+ #pragma warning(disable: 4244)
+
+typedef struct _C_double_complex
+ { /* double complex */
+ double _Val[2];
+ } _C_double_complex;
+
+typedef struct _C_float_complex
+ { /* float complex */
+ float _Val[2];
+ } _C_float_complex;
+
+typedef struct _C_ldouble_complex
+ { /* long double complex */
+ long double _Val[2];
+ } _C_ldouble_complex;
+
+_STD_BEGIN
+typedef ::_C_double_complex _Dcomplex_value;
+typedef ::_C_float_complex _Fcomplex_value;
+typedef ::_C_ldouble_complex _Lcomplex_value;
+
+#define __STD_COMPLEX /* signal presence of complex classes */
+
+ // TEMPLATE CLASS _Ctraits
+template
+ class _Ctraits
+ { // complex traits for _Ty
+public:
+ static _Ty __cdecl _Cosh(_Ty _Left, _Ty _Right)
+ { // return cosh(_Left) * _Right
+ return (::_Cosh((double)_Left, (double)_Right));
+ }
+
+ static short __cdecl _Exp(_Ty *_Pleft, _Ty _Right, short _Exponent)
+ { // compute exp(*_Pleft) * _Right * 2 ^ _Exponent
+ double _Tmp = (double)*_Pleft;
+ short _Ans = ::_Exp(&_Tmp, (double)_Right, _Exponent);
+ *_Pleft = (_Ty)_Tmp;
+ return (_Ans);
+ }
+
+ static _Ty __cdecl _Infv(_Ty)
+ { // return infinity
+ return (::_Inf._Double);
+ }
+
+ static bool __cdecl _Isinf(_Ty _Left)
+ { // test for infinity
+ double _Tmp = (double)_Left;
+ return (::_Dtest(&_Tmp) == _INFCODE);
+ }
+
+ static bool __cdecl _Isnan(_Ty _Left)
+ { // test for NaN
+ double _Tmp = (double)_Left;
+ return (::_Dtest(&_Tmp) == _NANCODE);
+ }
+
+ static _Ty __cdecl _Nanv(_Ty)
+ { // return NaN
+ return (::_Nan._Double);
+ }
+
+ static _Ty __cdecl _Sinh(_Ty _Left, _Ty _Right)
+ { // return sinh(_Left) * _Right
+ return (::_Sinh((double)_Left, (double)_Right));
+ }
+
+ static _Ty __cdecl atan2(_Ty _Yval, _Ty _Xval)
+ { // return atan(_Yval / _Xval)
+ return (::atan2((double)_Yval, (double)_Xval));
+ }
+
+ static _Ty __cdecl cos(_Ty _Left)
+ { // return cos(_Left)
+ return (::cos((double)_Left));
+ }
+
+ static _Ty __cdecl exp(_Ty _Left)
+ { // return exp(_Left)
+ return (::exp((double)_Left));
+ }
+
+ static _Ty __cdecl ldexp(_Ty _Left, int _Exponent)
+ { // return _Left * 2 ^ _Exponent
+ return (::ldexp((double)_Left, _Exponent));
+ }
+
+ static _Ty __cdecl log(_Ty _Left)
+ { // return log(_Left)
+ return (::log((double)_Left));
+ }
+
+ static _Ty __cdecl pow(_Ty _Left, _Ty _Right)
+ { // return _Left ^ _Right
+ return (::pow((double)_Left, (double)_Right));
+ }
+
+ static _Ty __cdecl sin(_Ty _Left)
+ { // return sin(_Left)
+ return (::sin((double)_Left));
+ }
+
+ static _Ty __cdecl sqrt(_Ty _Left)
+ { // return sqrt(_Left)
+ return (::sqrt((double)_Left));
+ }
+
+ static _Ty __cdecl tan(_Ty _Left)
+ { // return tan(_Left)
+ return (::tan((double)_Left));
+ }
+ };
+
+ // CLASS _Ctraits
+template<> class _CRTIMP2 _Ctraits
+ { // complex traits for long double
+public:
+ typedef long double _Ty;
+
+ static _Ty __cdecl _Cosh(_Ty _Left, _Ty _Right)
+ { // return cosh(_Left) * _Right
+ return (::_LCosh(_Left, _Right));
+ }
+
+ static short __cdecl _Exp(_Ty *_Pleft, _Ty _Right, short _Exponent)
+ { // compute exp(*_Pleft) * _Right * 2 ^ _Exponent
+ return (::_LExp(_Pleft, _Right, _Exponent));
+ }
+
+ static _Ty __cdecl _Infv(_Ty)
+ { // return infinity
+ return (::_LInf._Long_double);
+ }
+
+ static bool __cdecl _Isinf(_Ty _Left)
+ { // test for infinity
+ return (::_LDtest(&_Left) == _INFCODE);
+ }
+
+ static bool __cdecl _Isnan(_Ty _Left)
+ { // test for NaN
+ return (::_LDtest(&_Left) == _NANCODE);
+ }
+
+ static _Ty __cdecl _Nanv(_Ty)
+ { // return NaN
+ return (::_LNan._Long_double);
+ }
+
+ static _Ty __cdecl _Sinh(_Ty _Left, _Ty _Right)
+ { // return sinh(_Left) * _Right
+ return (::_LSinh(_Left, _Right));
+ }
+
+ static _Ty __cdecl atan2(_Ty _Yval, _Ty _Xval)
+ { // return atan(_Yval / _Xval)
+ return (::atan2l(_Yval, _Xval));
+ }
+
+ static _Ty __cdecl cos(_Ty _Left)
+ { // return cos(_Left)
+ return (::cosl(_Left));
+ }
+
+ static _Ty __cdecl exp(_Ty _Left)
+ { // return exp(_Left)
+ return (::expl(_Left));
+ }
+
+ static _Ty __cdecl ldexp(_Ty _Left, int _Exponent)
+ { // return _Left * 2 ^ _Exponent
+ return (::ldexpl(_Left, _Exponent));
+ }
+
+ static _Ty __cdecl log(_Ty _Left)
+ { // return log(_Left)
+ return (::logl(_Left));
+ }
+
+ static _Ty __cdecl pow(_Ty _Left, _Ty _Right)
+ { // return _Left ^ _Right
+ return (::powl(_Left, _Right));
+ }
+
+ static _Ty __cdecl sin(_Ty _Left)
+ { // return sin(_Left)
+ return (::sinl(_Left));
+ }
+
+ static _Ty __cdecl sqrt(_Ty _Left)
+ { // return sqrt(_Left)
+ return (::sqrtl(_Left));
+ }
+
+ static _Ty __cdecl tan(_Ty _Left)
+ { // return tan(_Left)
+ return (::tanl(_Left));
+ }
+ };
+
+ // CLASS _Ctraits
+template<> class _CRTIMP2 _Ctraits
+ { // complex traits for double
+public:
+ typedef double _Ty;
+
+ static _Ty __cdecl _Cosh(_Ty _Left, _Ty _Right)
+ { // return cosh(_Left) * _Right
+ return (::_Cosh(_Left, _Right));
+ }
+
+ static short __cdecl _Exp(_Ty *_Pleft, _Ty _Right, short _Exponent)
+ { // compute exp(*_Pleft) * _Right * 2 ^ _Exponent
+ return (::_Exp(_Pleft, _Right, _Exponent));
+ }
+
+ static _Ty __cdecl _Infv(_Ty)
+ { // return infinity
+ return (::_Inf._Double);
+ }
+
+ static bool __cdecl _Isinf(_Ty _Left)
+ { // test for infinity
+ return (::_Dtest(&_Left) == _INFCODE);
+ }
+
+ static bool __cdecl _Isnan(_Ty _Left)
+ { // test for NaN
+ return (::_Dtest(&_Left) == _NANCODE);
+ }
+
+ static _Ty __cdecl _Nanv(_Ty)
+ { // return NaN
+ return (::_Nan._Double);
+ }
+
+ static _Ty __cdecl _Sinh(_Ty _Left, _Ty _Right)
+ { // return sinh(_Left) * _Right
+ return (::_Sinh(_Left, _Right));
+ }
+
+ static _Ty __cdecl atan2(_Ty _Yval, _Ty _Xval)
+ { // return atan(_Yval / _Xval)
+ return (::atan2(_Yval, _Xval));
+ }
+
+ static _Ty __cdecl cos(_Ty _Left)
+ { // return cos(_Left)
+ return (::cos(_Left));
+ }
+
+ static _Ty __cdecl exp(_Ty _Left)
+ { // return exp(_Left)
+ return (::exp(_Left));
+ }
+
+ static _Ty __cdecl ldexp(_Ty _Left, int _Exponent)
+ { // return _Left * 2 ^ _Exponent
+ return (::ldexp(_Left, _Exponent));
+ }
+
+ static _Ty __cdecl log(_Ty _Left)
+ { // return log(_Left)
+ return (::log(_Left));
+ }
+
+ static _Ty __cdecl pow(_Ty _Left, _Ty _Right)
+ { // return _Left ^ _Right
+ return (::pow(_Left, _Right));
+ }
+
+ static _Ty __cdecl sin(_Ty _Left)
+ { // return sin(_Left)
+ return (::sin(_Left));
+ }
+
+ static _Ty __cdecl sqrt(_Ty _Left)
+ { // return sqrt(_Left)
+ return (::sqrt(_Left));
+ }
+
+ static _Ty __cdecl tan(_Ty _Left)
+ { // return tan(_Left)
+ return (::tan(_Left));
+ }
+ };
+
+ // CLASS _Ctraits
+template<> class _CRTIMP2 _Ctraits
+ { // complex traits for float
+public:
+ typedef float _Ty;
+
+ static _Ty __cdecl _Cosh(_Ty _Left, _Ty _Right)
+ { // return cosh(_Left) * _Right
+ return (::_FCosh(_Left, _Right));
+ }
+
+ static short __cdecl _Exp(_Ty *_Pleft, _Ty _Right, short _Exponent)
+ { // compute exp(*_Pleft) * _Right * 2 ^ _Exponent
+ return (::_FExp(_Pleft, _Right, _Exponent));
+ }
+
+ static _Ty __cdecl _Infv(_Ty)
+ { // return infinity
+ return (::_FInf._Float);
+ }
+
+ static bool __cdecl _Isinf(_Ty _Left)
+ { // test for infinity
+ return (::_FDtest(&_Left) == _INFCODE);
+ }
+
+ static bool __cdecl _Isnan(_Ty _Left)
+ { // test for NaN
+ return (::_FDtest(&_Left) == _NANCODE);
+ }
+
+ static _Ty __cdecl _Nanv(_Ty)
+ { // return NaN
+ return (::_FNan._Float);
+ }
+
+ static _Ty __cdecl _Sinh(_Ty _Left, _Ty _Right)
+ { // return sinh(_Left) * _Right
+ return (::_FSinh(_Left, _Right));
+ }
+
+ static _Ty __cdecl atan2(_Ty _Yval, _Ty _Xval)
+ { // return atan(_Yval / _Xval)
+ return (::atan2f(_Yval, _Xval));
+ }
+
+ static _Ty __cdecl cos(_Ty _Left)
+ { // return cos(_Left)
+ return (::cosf(_Left));
+ }
+
+ static _Ty __cdecl exp(_Ty _Left)
+ { // return exp(_Left)
+ return (::expf(_Left));
+ }
+
+ static _Ty __cdecl ldexp(_Ty _Left, int _Exponent)
+ { // return _Left * 2 ^ _Exponent
+ return (::ldexpf(_Left, _Exponent));
+ }
+
+ static _Ty __cdecl log(_Ty _Left)
+ { // return log(_Left)
+ return (::logf(_Left));
+ }
+
+ static _Ty __cdecl pow(_Ty _Left, _Ty _Right)
+ { // return _Left ^ _Right
+ return (::powf(_Left, _Right));
+ }
+
+ static _Ty __cdecl sin(_Ty _Left)
+ { // return sin(_Left)
+ return (::sinf(_Left));
+ }
+
+ static _Ty __cdecl sqrt(_Ty _Left)
+ { // return sqrt(_Left)
+ return (::sqrtf(_Left));
+ }
+
+ static _Ty __cdecl tan(_Ty _Left)
+ { // return tan(_Left)
+ return (::tanf(_Left));
+ }
+ };
+
+template
+ class complex;
+template<> class _CRTIMP2 complex;
+template<> class _CRTIMP2 complex;
+template<> class _CRTIMP2 complex;
+
+ // TEMPLATE CLASS _Complex_value
+template
+ struct _Complex_value
+ { /* templatized complex value */
+ _Ty _Val[2];
+ };
+
+ // TEMPLATE CLASS _Complex_base
+template
+ class _Complex_base
+ : public _Valbase
+ { // base for all complex types
+public:
+ typedef _Ctraits<_Ty> _Myctraits;
+ typedef _Complex_base<_Ty, _Valbase> _Myt;
+ typedef _Ty value_type;
+
+ _Complex_base(const _Ty& _Realval, const _Ty& _Imagval)
+ { // construct from components of same type
+ this->_Val[0] = _Realval;
+ this->_Val[1] = _Imagval;
+ }
+
+ _Ty real(const _Ty& _Right)
+ { // set real component
+ return (this->_Val[0] = _Right);
+ }
+
+ _Ty imag(const _Ty& _Right)
+ { // set imaginary component
+ return (this->_Val[1] = _Right);
+ }
+
+ _Ty real() const
+ { // return real component
+ return (this->_Val[0]);
+ }
+
+ _Ty imag() const
+ { // return imaginary component
+ return (this->_Val[1]);
+ }
+
+protected:
+ template inline
+ void _Add(const complex<_Other>& _Right)
+ { // add other complex
+ this->_Val[0] = this->_Val[0] + (_Ty)_Right.real();
+ this->_Val[1] = this->_Val[1] + (_Ty)_Right.imag();
+ }
+
+ template inline
+ void _Sub(const complex<_Other>& _Right)
+ { // subtract other complex
+ this->_Val[0] = this->_Val[0] - (_Ty)_Right.real();
+ this->_Val[1] = this->_Val[1] - (_Ty)_Right.imag();
+ }
+
+ template inline
+ void _Mul(const complex<_Other>& _Right)
+ { // multiply by other complex
+ _Ty _Rightreal = (_Ty)_Right.real();
+ _Ty _Rightimag = (_Ty)_Right.imag();
+
+ _Ty _Tmp = this->_Val[0] * _Rightreal - this->_Val[1] * _Rightimag;
+ this->_Val[1] = this->_Val[0] * _Rightimag + this->_Val[1] * _Rightreal;
+ this->_Val[0] = _Tmp;
+ }
+
+ template inline
+ void _Div(const complex<_Other>& _Right)
+ { // divide by other complex
+ typedef _Ctraits<_Ty> _Myctraits;
+ _Ty _Rightreal = (_Ty)_Right.real();
+ _Ty _Rightimag = (_Ty)_Right.imag();
+
+ if (_Myctraits::_Isnan(_Rightreal) || _Myctraits::_Isnan(_Rightimag))
+ { // set NaN result
+ this->_Val[0] = _Myctraits::_Nanv(_Rightreal);
+ this->_Val[1] = this->_Val[0];
+ }
+ else if ((_Rightimag < 0 ? -_Rightimag : +_Rightimag)
+ < (_Rightreal < 0 ? -_Rightreal : +_Rightreal))
+ { // |_Right.imag()| < |_Right.real()|
+ _Ty _Wr = _Rightimag / _Rightreal;
+ _Ty _Wd = _Rightreal + _Wr * _Rightimag;
+
+ if (_Myctraits::_Isnan(_Wd) || _Wd == 0)
+ { // set NaN result
+ this->_Val[0] = _Myctraits::_Nanv(_Rightreal);
+ this->_Val[1] = this->_Val[0];
+ }
+ else
+ { // compute representable result
+ _Ty _Tmp = (this->_Val[0] + this->_Val[1] * _Wr) / _Wd;
+ this->_Val[1] = (this->_Val[1] - this->_Val[0] * _Wr) / _Wd;
+ this->_Val[0] = _Tmp;
+ }
+ }
+ else if (_Rightimag == 0)
+ { // set NaN result
+ this->_Val[0] = _Myctraits::_Nanv(_Rightreal);
+ this->_Val[1] = this->_Val[0];
+ }
+ else
+ { // 0 < |_Right.real()| <= |_Right.imag()|
+ _Ty _Wr = _Rightreal / _Rightimag;
+ _Ty _Wd = _Rightimag + _Wr * _Rightreal;
+
+ if (_Myctraits::_Isnan(_Wd) || _Wd == 0)
+ { // set NaN result
+ this->_Val[0] = _Myctraits::_Nanv(_Rightreal);
+ this->_Val[1] = this->_Val[0];
+ }
+ else
+ { // compute representable result
+ _Ty _Tmp = (this->_Val[0] * _Wr + this->_Val[1]) / _Wd;
+ this->_Val[1] = (this->_Val[1] * _Wr - this->_Val[0]) / _Wd;
+ this->_Val[0] = _Tmp;
+ }
+ }
+ }
+ };
+
+ // CLASS complex
+template<> class _CRTIMP2 complex
+ : public _Complex_base
+ { // complex with float components
+public:
+ typedef float _Ty;
+ typedef complex<_Ty> _Myt;
+
+ explicit complex(const complex&); // defined below
+
+ explicit complex(const complex&); // defined below
+
+ complex(const _Ty& _Realval = 0, const _Ty& _Imagval = 0)
+ : _Complex_base(_Realval, _Imagval)
+ { // construct from float components
+ }
+
+ complex(const _Fcomplex_value& _Right)
+ : _Complex_base(_Right._Val[0],
+ _Right._Val[1])
+ { // construct from float complex value
+ }
+
+ complex<_Ty>& operator=(const _Ty& _Right)
+ { // assign real
+ this->_Val[0] = _Right;
+ this->_Val[1] = 0;
+ return (*this);
+ }
+
+ _Myt& operator+=(const _Ty& _Right)
+ { // add real
+ this->_Val[0] = this->_Val[0] + _Right;
+ return (*this);
+ }
+
+ _Myt& operator-=(const _Ty& _Right)
+ { // subtract real
+ this->_Val[0] = this->_Val[0] - _Right;
+ return (*this);
+ }
+
+ _Myt& operator*=(const _Ty& _Right)
+ { // multiply by real
+ this->_Val[0] = this->_Val[0] * _Right;
+ this->_Val[1] = this->_Val[1] * _Right;
+ return (*this);
+ }
+
+ _Myt& operator/=(const _Ty& _Right)
+ { // divide by real
+ this->_Val[0] = this->_Val[0] / _Right;
+ this->_Val[1] = this->_Val[1] / _Right;
+ return (*this);
+ }
+
+ _Myt& operator=(const _Myt& _Right)
+ { // assign other complex
+ this->_Val[0] = _Right.real();
+ this->_Val[1] = _Right.imag();
+ return (*this);
+ }
+
+ _Myt& operator+=(const _Myt& _Right)
+ { // add other complex
+ this->_Add(_Right);
+ return (*this);
+ }
+
+ _Myt& operator-=(const _Myt& _Right)
+ { // subtract other complex
+ this->_Sub(_Right);
+ return (*this);
+ }
+
+ _Myt& operator*=(const _Myt& _Right)
+ { // multiply by other complex
+ this->_Mul(_Right);
+ return (*this);
+ }
+
+ _Myt& operator/=(const _Myt& _Right)
+ { // divide by other complex
+ this->_Div(_Right);
+ return (*this);
+ }
+
+ template
+ _Myt& operator=(const complex<_Other>& _Right)
+ { // assign other complex type
+ this->_Val[0] = (_Ty)_Right.real();
+ this->_Val[1] = (_Ty)_Right.imag();
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator+=(const complex<_Other>& _Right)
+ { // add other complex
+ this->_Add(_Right);
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator-=(const complex<_Other>& _Right)
+ { // subtract other complex
+ this->_Sub(_Right);
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator*=(const complex<_Other>& _Right)
+ { // multiply by other complex
+ this->_Mul(_Right);
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator/=(const complex<_Other>& _Right)
+ { // divide by other complex
+ this->_Div(_Right);
+ return (*this);
+ }
+ };
+
+ // CLASS complex
+template<> class _CRTIMP2 complex
+ : public _Complex_base
+ { // complex with double components
+public:
+ typedef double _Ty;
+ typedef complex<_Ty> _Myt;
+
+ complex(const complex&); // defined below
+
+ explicit complex(const complex&); // defined below
+
+ complex(const _Ty& _Realval = 0, const _Ty& _Imagval = 0)
+ : _Complex_base(_Realval, _Imagval)
+ { // construct from double components
+ }
+
+ complex(const _Dcomplex_value& _Right)
+ : _Complex_base(_Right._Val[0],
+ _Right._Val[1])
+ { // construct from double complex value
+ }
+
+ complex<_Ty>& operator=(const _Ty& _Right)
+ { // assign real
+ this->_Val[0] = _Right;
+ this->_Val[1] = 0;
+ return (*this);
+ }
+
+ _Myt& operator+=(const _Ty& _Right)
+ { // add real
+ this->_Val[0] = this->_Val[0] + _Right;
+ return (*this);
+ }
+
+ _Myt& operator-=(const _Ty& _Right)
+ { // subtract real
+ this->_Val[0] = this->_Val[0] - _Right;
+ return (*this);
+ }
+
+ _Myt& operator*=(const _Ty& _Right)
+ { // multiply by real
+ this->_Val[0] = this->_Val[0] * _Right;
+ this->_Val[1] = this->_Val[1] * _Right;
+ return (*this);
+ }
+
+ _Myt& operator/=(const _Ty& _Right)
+ { // divide by real
+ this->_Val[0] = this->_Val[0] / _Right;
+ this->_Val[1] = this->_Val[1] / _Right;
+ return (*this);
+ }
+
+ _Myt& operator=(const _Myt& _Right)
+ { // assign other complex
+ this->_Val[0] = _Right.real();
+ this->_Val[1] = _Right.imag();
+ return (*this);
+ }
+
+ _Myt& operator+=(const _Myt& _Right)
+ { // add other complex
+ this->_Add(_Right);
+ return (*this);
+ }
+
+ _Myt& operator-=(const _Myt& _Right)
+ { // subtract other complex
+ this->_Sub(_Right);
+ return (*this);
+ }
+
+ _Myt& operator*=(const _Myt& _Right)
+ { // multiply by other complex
+ this->_Mul(_Right);
+ return (*this);
+ }
+
+ _Myt& operator/=(const _Myt& _Right)
+ { // divide by other complex
+ this->_Div(_Right);
+ return (*this);
+ }
+
+ template
+ _Myt& operator=(const complex<_Other>& _Right)
+ { // assign other complex type
+ this->_Val[0] = (_Ty)_Right.real();
+ this->_Val[1] = (_Ty)_Right.imag();
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator+=(const complex<_Other>& _Right)
+ { // add other complex
+ this->_Add(_Right);
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator-=(const complex<_Other>& _Right)
+ { // subtract other complex
+ this->_Sub(_Right);
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator*=(const complex<_Other>& _Right)
+ { // multiply by other complex
+ this->_Mul(_Right);
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator/=(const complex<_Other>& _Right)
+ { // divide by other complex
+ this->_Div(_Right);
+ return (*this);
+ }
+ };
+
+ // CLASS complex
+template<> class _CRTIMP2 complex
+ : public _Complex_base
+ { // complex with long double components
+public:
+ typedef long double _Ty;
+ typedef complex<_Ty> _Myt;
+
+ complex(const complex&); // defined below
+
+ complex(const complex&); // defined below
+
+ complex(const _Ty& _Realval = 0, const _Ty& _Imagval = 0)
+ : _Complex_base(_Realval, _Imagval)
+ { // construct from long double components
+ }
+
+ complex(const _Lcomplex_value& _Right)
+ : _Complex_base(_Right._Val[0],
+ _Right._Val[1])
+ { // construct from long double complex value
+ }
+
+ complex<_Ty>& operator=(const _Ty& _Right)
+ { // assign real
+ this->_Val[0] = _Right;
+ this->_Val[1] = 0;
+ return (*this);
+ }
+
+ _Myt& operator+=(const _Ty& _Right)
+ { // add real
+ this->_Val[0] = this->_Val[0] + _Right;
+ return (*this);
+ }
+
+ _Myt& operator-=(const _Ty& _Right)
+ { // subtract real
+ this->_Val[0] = this->_Val[0] - _Right;
+ return (*this);
+ }
+
+ _Myt& operator*=(const _Ty& _Right)
+ { // multiply by real
+ this->_Val[0] = this->_Val[0] * _Right;
+ this->_Val[1] = this->_Val[1] * _Right;
+ return (*this);
+ }
+
+ _Myt& operator/=(const _Ty& _Right)
+ { // divide by real
+ this->_Val[0] = this->_Val[0] / _Right;
+ this->_Val[1] = this->_Val[1] / _Right;
+ return (*this);
+ }
+
+ _Myt& operator=(const _Myt& _Right)
+ { // assign other complex
+ this->_Val[0] = _Right.real();
+ this->_Val[1] = _Right.imag();
+ return (*this);
+ }
+
+ _Myt& operator+=(const _Myt& _Right)
+ { // add other complex
+ this->_Add(_Right);
+ return (*this);
+ }
+
+ _Myt& operator-=(const _Myt& _Right)
+ { // subtract other complex
+ this->_Sub(_Right);
+ return (*this);
+ }
+
+ _Myt& operator*=(const _Myt& _Right)
+ { // multiply by other complex
+ this->_Mul(_Right);
+ return (*this);
+ }
+
+ _Myt& operator/=(const _Myt& _Right)
+ { // divide by other complex
+ this->_Div(_Right);
+ return (*this);
+ }
+
+ template
+ _Myt& operator=(const complex<_Other>& _Right)
+ { // assign other complex type
+ this->_Val[0] = (_Ty)_Right.real();
+ this->_Val[1] = (_Ty)_Right.imag();
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator+=(const complex<_Other>& _Right)
+ { // add other complex
+ this->_Add(_Right);
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator-=(const complex<_Other>& _Right)
+ { // subtract other complex
+ this->_Sub(_Right);
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator*=(const complex<_Other>& _Right)
+ { // multiply by other complex
+ this->_Mul(_Right);
+ return (*this);
+ }
+
+ template inline
+ _Myt& operator/=(const complex<_Other>& _Right)
+ { // divide by other complex
+ this->_Div(_Right);
+ return (*this);
+ }
+ };
+
+ // CONSTRUCTORS FOR complex SPECIALIZATIONS
+inline
+ complex::complex(const complex& _Right)
+ : _Complex_base(
+ (_Ty)_Right.real(), (_Ty)_Right.imag())
+ { // construct complex from complex
+ }
+
+inline
+ complex