<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx</link><description>STL enjoys speaking in the third person and also enjoys bringing you this exclusive news: Visual Studio 2008 Service Pack 1 (VC9 SP1) contains the TR1 and MFC library extensions that were originally released in the Visual C++ 2008 Feature Pack Refresh</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>TR1 Fixes In VC9 SP1 | Easycoded</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8848992</link><pubDate>Mon, 11 Aug 2008 22:53:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8848992</guid><dc:creator>TR1 Fixes In VC9 SP1 | Easycoded</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.easycoded.com/tr1-fixes-in-vc9-sp1"&gt;http://www.easycoded.com/tr1-fixes-in-vc9-sp1&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8849014</link><pubDate>Mon, 11 Aug 2008 23:00:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8849014</guid><dc:creator>Adam C Merz</dc:creator><description>&lt;p&gt;Out of curiousity, was any performance testing of tr1::regex done comparing to boost::xpressive rather than boost::regex? Given the introduction of boost::xpressive, boost::regex strikes me as a legacy library, only useful for a mostly-TR1-compatible API.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8849191</link><pubDate>Tue, 12 Aug 2008 00:29:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8849191</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;Remember that &amp;lt;regex&amp;gt; is part of the C++0x Standard Library, so I'd hardly call it &amp;quot;legacy&amp;quot;.&lt;/p&gt;
&lt;p&gt;I wasn't familiar with Boost.Xpressive, although from glancing at its documentation it appears to be extremely powerful. I'll look at it for future performance comparisons, thanks.&lt;/p&gt;
</description></item><item><title>STL/CLR fixed?</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8849281</link><pubDate>Tue, 12 Aug 2008 01:05:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8849281</guid><dc:creator>someone</dc:creator><description>&lt;p&gt;STL/CLR is embarrassingly slow compared to BCL. Has this been addressed?&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8849953</link><pubDate>Tue, 12 Aug 2008 08:21:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8849953</guid><dc:creator>int19h</dc:creator><description>&lt;p&gt;All good stuff. I wish the trait framework used to mark classes for swap optimization was public and documented, though, so we could use it for our own (unportable, obviously - though nothing an #ifdef can't alleviate - but sometimes performance is more important).&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8850144</link><pubDate>Tue, 12 Aug 2008 10:17:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8850144</guid><dc:creator>hito</dc:creator><description>&lt;p&gt;SP1's unordered_set is horribly slow compare to boost::unordered_set or even std::set.&lt;/p&gt;
&lt;p&gt;and worse, it's destructer is unbelievably slow.&lt;/p&gt;
&lt;p&gt;but if i called clear() before destructer is called, it is not so slow.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8851268</link><pubDate>Tue, 12 Aug 2008 16:39:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8851268</guid><dc:creator>MR</dc:creator><description>&lt;p&gt;Does anyone have a sense of how TR1 regex compares to the exiting ATL regex implementation (CAtlRegExp)? From a performance and or functional perspective?&lt;/p&gt;
</description></item><item><title>Visual Studio Links #64</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8851462</link><pubDate>Tue, 12 Aug 2008 17:10:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8851462</guid><dc:creator>Visual Studio Hacks</dc:creator><description>&lt;p&gt;My latest in a series of the weekly, or more often, summary of interesting links I come across related to Visual Studio. Yesterday, Visual Studio 2008 SP1 and .Net 3.5 SP1 were released. Below is a list of links related to those releases: Greg Duncan&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8852051</link><pubDate>Tue, 12 Aug 2008 19:01:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8852051</guid><dc:creator>Richard Webb</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I've run the Boost regression tests with SP1 final and a lot of the TR1 failures i was seeing before have been fixed, but there are still a couple left.&lt;/p&gt;
&lt;p&gt;For example, there is a problem with a missing result_type definition in Bind (&lt;a rel="nofollow" target="_new" href="http://tinyurl.com/5myz9f"&gt;http://tinyurl.com/5myz9f&lt;/a&gt;). You previously mentioned (&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/vcblog/archive/2008/04/07/visual-c-2008-feature-pack-released.aspx#8405685"&gt;http://blogs.msdn.com/vcblog/archive/2008/04/07/visual-c-2008-feature-pack-released.aspx#8405685&lt;/a&gt;) that this was a known bug, so did it not get fixed in SP1?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Richard Webb&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8852253</link><pubDate>Tue, 12 Aug 2008 19:40:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8852253</guid><dc:creator>Adam C Merz</dc:creator><description>&lt;p&gt;Re: boost::regex -- by &amp;quot;legacy&amp;quot; I mean, if you're using Boost, then presumably you want something better than what's in the standard; because &amp;lt;regex&amp;gt; is standard in C++0x/TR1, I'd call boost::regex legacy since it doesn't offer much beyond what the standard already has. boost::xpressive, on the other hand, does have quite an advantage over &amp;lt;regex&amp;gt; in terms of design and performance, especially in regards to static expressions.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8852487</link><pubDate>Tue, 12 Aug 2008 20:20:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8852487</guid><dc:creator>jmm</dc:creator><description>&lt;p&gt;Your post lists the 16 fixes for TR1, but what about the 60 fixes for MFC? &amp;nbsp;Is there a post or article somewhere about these?&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8852622</link><pubDate>Tue, 12 Aug 2008 20:49:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8852622</guid><dc:creator>jmm</dc:creator><description>&lt;p&gt;I went to the official page for Microsoft Visual Studio 2008 Service Pack 1 (exe), which is: &lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;At the bottom, within section [Related Resources], I clicked on:&lt;/p&gt;
&lt;p&gt;2. Fixes included in this Service Packs (KB945140)&lt;/p&gt;
&lt;p&gt;This gave me [Visual Studio 2008 Service Pack 1 Beta release notes and a list of fixed issues], which was published April 29, 2008.&lt;/p&gt;
&lt;p&gt;Hopefully the actual fix list is posted sometime. &amp;nbsp;Info on the MFC fixes would be great too.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8854405</link><pubDate>Wed, 13 Aug 2008 02:25:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8854405</guid><dc:creator>Pat Brenner</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I've just posted a summary of the bugs that we fixed in MFC for VS2008 SP1. &amp;nbsp;See it here: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/vcblog/archive/2008/08/12/bugs-fixed-in-mfc-in-visual-studio-2008-sp1.aspx"&gt;http://blogs.msdn.com/vcblog/archive/2008/08/12/bugs-fixed-in-mfc-in-visual-studio-2008-sp1.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Pat Brenner&lt;/p&gt;
&lt;p&gt;Visual C++ Libraries Development&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8854552</link><pubDate>Wed, 13 Aug 2008 02:54:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8854552</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;[int19h]&lt;/p&gt;
&lt;p&gt;&amp;gt; I wish the trait framework used to mark classes for swap optimization&lt;/p&gt;
&lt;p&gt;&amp;gt; was public and documented, though, so we could use it for our own&lt;/p&gt;
&lt;p&gt;&amp;gt; (unportable, obviously - though nothing an #ifdef can't alleviate - but&lt;/p&gt;
&lt;p&gt;&amp;gt; sometimes performance is more important).&lt;/p&gt;
&lt;p&gt;This is probably as documented as it'll get. &amp;nbsp;See below for my utterly unsupported example.&lt;/p&gt;
&lt;p&gt;[hito]&lt;/p&gt;
&lt;p&gt;&amp;gt; SP1's unordered_set is horribly slow compare to boost::unordered_set or even std::set.&lt;/p&gt;
&lt;p&gt;&amp;gt; and worse, it's destructer is unbelievably slow.&lt;/p&gt;
&lt;p&gt;&amp;gt; but if i called clear() before destructer is called, it is not so slow.&lt;/p&gt;
&lt;p&gt;Please file bugs with specific test cases through Microsoft Connect. We've identified one major performance problem in tr1::unordered_set; erase() doesn't achieve its required complexity.&lt;/p&gt;
&lt;p&gt;(I thought Boost 1.35.0 hadn't implemented the unordered containers yet; see &lt;a rel="nofollow" target="_new" href="http://www.boost.org/doc/libs/1_35_0/doc/html/boost_tr1.html"&gt;http://www.boost.org/doc/libs/1_35_0/doc/html/boost_tr1.html&lt;/a&gt; .)&lt;/p&gt;
&lt;p&gt;[MR]&lt;/p&gt;
&lt;p&gt;&amp;gt; Does anyone have a sense of how TR1 regex compares to the exiting ATL regex implementation (CAtlRegExp)?&lt;/p&gt;
&lt;p&gt;&amp;gt; From a performance and or functional perspective?&lt;/p&gt;
&lt;p&gt;CAtlRegExp, along with the rest of ATL Server, was removed from VC9.&lt;/p&gt;
&lt;p&gt;Hopefully, TR1 Regex outperforms CAtlRegExp, but we haven't done any performance comparisons there. &amp;nbsp;From a usability perspective, TR1 Regex wins hands down.&lt;/p&gt;
&lt;p&gt;[Richard Webb]&lt;/p&gt;
&lt;p&gt;&amp;gt; I've run the Boost regression tests with SP1 final and a lot of the TR1&lt;/p&gt;
&lt;p&gt;&amp;gt; failures i was seeing before have been fixed, but there are still a couple left.&lt;/p&gt;
&lt;p&gt;&amp;gt; For example, there is a problem with a missing result_type definition in Bind&lt;/p&gt;
&lt;p&gt;&amp;gt; (&lt;a rel="nofollow" target="_new" href="http://tinyurl.com/5myz9f"&gt;http://tinyurl.com/5myz9f&lt;/a&gt;). You previously mentioned&lt;/p&gt;
&lt;p&gt;&amp;gt; (&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/vcblog/archive/2008/04/07/visual-c-2008-feature-pack-released.aspx#8405685"&gt;http://blogs.msdn.com/vcblog/archive/2008/04/07/visual-c-2008-feature-pack-released.aspx#8405685&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;gt; that this was a known bug, so did it not get fixed in SP1?&lt;/p&gt;
&lt;p&gt;Correct; this was postponed to VC10.&lt;/p&gt;
&lt;p&gt;And here's that example for int19h:&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;type meow.cpp&lt;/p&gt;
&lt;p&gt;#include &amp;lt;iostream&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;ostream&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;vector&amp;gt;&lt;/p&gt;
&lt;p&gt;using namespace std;&lt;/p&gt;
&lt;p&gt;namespace feline {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;struct kitty {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;kitty() { cout &amp;lt;&amp;lt; &amp;quot;default ctor&amp;quot; &amp;lt;&amp;lt; endl; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;kitty(const kitty&amp;amp;) { cout &amp;lt;&amp;lt; &amp;quot;copy ctor&amp;quot; &amp;lt;&amp;lt; endl; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;kitty&amp;amp; operator=(const kitty&amp;amp;) { cout &amp;lt;&amp;lt; &amp;quot;assign&amp;quot; &amp;lt;&amp;lt; endl; return *this; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;~kitty() { cout &amp;lt;&amp;lt; &amp;quot;dtor&amp;quot; &amp;lt;&amp;lt; endl; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;void swap(kitty&amp;amp;) { cout &amp;lt;&amp;lt; &amp;quot;swap&amp;quot; &amp;lt;&amp;lt; endl; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;};&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;void swap(kitty&amp;amp; a, kitty&amp;amp; b) { a.swap(b); }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;// Specific to VC9 SP1 and above.&lt;/p&gt;
&lt;p&gt;// This machinery was broken for classes outside namespace std in VC9 RTM and below.&lt;/p&gt;
&lt;p&gt;// This machinery will not be present in VC10 and above.&lt;/p&gt;
&lt;p&gt;#if defined(_MSC_VER) &amp;amp;&amp;amp; _MSC_VER == 1500 &amp;amp;&amp;amp; _MSC_FULL_VER &amp;gt;= 150030729&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;#include &amp;lt;xutility&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;namespace std {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;template &amp;lt;&amp;gt; class _Move_operation_category&amp;lt;feline::kitty&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;typedef _Swap_move_tag _Move_cat;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;#endif&lt;/p&gt;
&lt;p&gt;int main() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;vector&amp;lt;feline::kitty&amp;gt; v;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &amp;quot;*** Constructing cat.&amp;quot; &amp;lt;&amp;lt; endl;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;feline::kitty cat;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &amp;quot;*** Pushing back cat #1.&amp;quot; &amp;lt;&amp;lt; endl;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;v.push_back(cat);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &amp;quot;*** Pushing back cat #2.&amp;quot; &amp;lt;&amp;lt; endl;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;v.push_back(cat);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &amp;quot;*** Destroying cat and v.&amp;quot; &amp;lt;&amp;lt; endl;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;cl /EHsc /nologo /W4 meow.cpp&lt;/p&gt;
&lt;p&gt;meow.cpp&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;meow&lt;/p&gt;
&lt;p&gt;*** Constructing cat.&lt;/p&gt;
&lt;p&gt;default ctor&lt;/p&gt;
&lt;p&gt;*** Pushing back cat #1.&lt;/p&gt;
&lt;p&gt;copy ctor&lt;/p&gt;
&lt;p&gt;default ctor&lt;/p&gt;
&lt;p&gt;dtor&lt;/p&gt;
&lt;p&gt;default ctor&lt;/p&gt;
&lt;p&gt;dtor&lt;/p&gt;
&lt;p&gt;*** Pushing back cat #2.&lt;/p&gt;
&lt;p&gt;copy ctor&lt;/p&gt;
&lt;p&gt;default ctor&lt;/p&gt;
&lt;p&gt;copy ctor&lt;/p&gt;
&lt;p&gt;swap&lt;/p&gt;
&lt;p&gt;dtor&lt;/p&gt;
&lt;p&gt;default ctor&lt;/p&gt;
&lt;p&gt;dtor&lt;/p&gt;
&lt;p&gt;dtor&lt;/p&gt;
&lt;p&gt;*** Destroying cat and v.&lt;/p&gt;
&lt;p&gt;dtor&lt;/p&gt;
&lt;p&gt;dtor&lt;/p&gt;
&lt;p&gt;dtor&lt;/p&gt;
&lt;p&gt;Note that the Swaptimization requires a default ctor.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8857225</link><pubDate>Wed, 13 Aug 2008 12:49:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8857225</guid><dc:creator>int19h</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Hopefully, VC10 will see C++0x finalized and implemented, with its move constructors and all, so we won't need this hack by that time.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8859595</link><pubDate>Wed, 13 Aug 2008 20:16:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8859595</guid><dc:creator>Richard Webb</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;(I thought Boost 1.35.0 hadn't implemented the unordered containers yet; see &lt;a rel="nofollow" target="_new" href="http://www.boost.org/doc/libs/1_35_0/doc/html/boost_tr1.html"&gt;http://www.boost.org/doc/libs/1_35_0/doc/html/boost_tr1.html&lt;/a&gt; .)&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;It didn't - they're new in 1.36, due any day now.&lt;/p&gt;
&lt;p&gt;See &lt;a rel="nofollow" target="_new" href="http://beta.boost.org/users/news/version_1_36_0"&gt;http://beta.boost.org/users/news/version_1_36_0&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8864865</link><pubDate>Thu, 14 Aug 2008 09:08:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8864865</guid><dc:creator>KluYa</dc:creator><description>&lt;p&gt;I see a lot of things are being remanded to VC10. Is there any timeframe on when VC10 will hit? Late 2009, early 2010?&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8867883</link><pubDate>Thu, 14 Aug 2008 23:41:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8867883</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;[KluYa]&lt;/p&gt;
&lt;p&gt;&amp;gt; I see a lot of things are being remanded to VC10.&lt;/p&gt;
&lt;p&gt;I'd say &amp;quot;some&amp;quot;, not &amp;quot;a lot&amp;quot;, except wrt &amp;lt;functional&amp;gt; and especially bind(). Only one bugfix was deliberately kept out of VC9 SP1 (this was the fairly extensive fix for the &amp;lt;memory&amp;gt; _InterlockedFoo problem, which was too risky for a service pack).&lt;/p&gt;
&lt;p&gt;&amp;gt; Is there any timeframe on when VC10 will hit?&lt;/p&gt;
&lt;p&gt;We're not talking about that yet.&lt;/p&gt;
&lt;p&gt;Stephan T. Lavavej, Visual C++ Libraries Developer&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8870643</link><pubDate>Fri, 15 Aug 2008 23:39:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8870643</guid><dc:creator>mikeb</dc:creator><description>&lt;p&gt;You said: &amp;quot;So, within a class that defines a member swap(), calling unqualified swap() doesn't activate ADL, nor does it even find std::swap() - it finds the member swap()&amp;quot;&lt;/p&gt;
&lt;p&gt;Does that mean the Scott Meyers' Item 25 in Effective C++ 3rd Ed. should be amended so that:&lt;/p&gt;
&lt;p&gt; - in a class that has a member swap(), instead of having a &amp;quot;using std::swap&amp;quot; declaration and directly calling an unqualified swap()&lt;/p&gt;
&lt;p&gt;it should:&lt;/p&gt;
&lt;p&gt; - call a wrapper non-member template function that has a &amp;quot;using std::swap&amp;quot; declaration and calls an unqualified swap() - ie., our own implementation of std::_Swap_adl() that's not in the std namespace and doesn't start with an '_'?&lt;/p&gt;
&lt;p&gt;It sounds like to be safe we should always call this non-member wrapper template function instead of calling swap(T&amp;amp;, T&amp;amp;) directly.&lt;/p&gt;
&lt;p&gt;Jeez - this name lookup stuff is so convoluted, I'm not even sure if this question makes any sense.&lt;/p&gt;
</description></item><item><title>VC9 SP1: problems with tr1::function?</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8870759</link><pubDate>Sat, 16 Aug 2008 00:25:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8870759</guid><dc:creator>grokbrsm</dc:creator><description>&lt;p&gt;The following code breaks with an access violation when executing line &lt;/p&gt;
&lt;p&gt; &amp;nbsp; (*i)(tmp);&lt;/p&gt;
&lt;p&gt;after an update to VC9 SP1. It works fine with RTM and even SP1 beta. Verified on two different machines, one (win XP x64) that had the beta, the other that didn't (win XP 32 bits).&lt;/p&gt;
&lt;p&gt;---------------------&lt;/p&gt;
&lt;p&gt;#include &amp;lt;iostream&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;vector&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;functional&amp;gt;&lt;/p&gt;
&lt;p&gt;struct my_class&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;void f() { std::cout &amp;lt;&amp;lt; &amp;quot;my_class::f()&amp;quot; &amp;lt;&amp;lt; std::endl; }&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
&lt;p&gt;void g(my_class x)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;std::cout &amp;lt;&amp;lt; &amp;quot;g(my_class)&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;struct h&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;void operator()(my_class) const {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;std::cout &amp;lt;&amp;lt; &amp;quot;h::operator()(my_class)&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
&lt;p&gt;int main()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;typedef std::tr1::function&amp;lt;void(my_class)&amp;gt; F;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;std::vector&amp;lt;F&amp;gt; ops;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;ops.push_back(&amp;amp;my_class::f);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;ops.push_back(&amp;amp;g);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;ops.push_back(h());&lt;/p&gt;
&lt;p&gt; my_class tmp;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;for (std::vector&amp;lt;F&amp;gt;::iterator i = ops.begin(); i != ops.end(); i++)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;(*i)(tmp);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;-------------------------&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8870789</link><pubDate>Sat, 16 Aug 2008 00:38:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8870789</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;&amp;gt; It sounds like to be safe we should always call this non-member wrapper template function instead of calling swap(T&amp;amp;, T&amp;amp;) directly.&lt;/p&gt;
&lt;p&gt;According to my understanding, yes.&lt;/p&gt;
&lt;p&gt;(Also according to my understanding, accidentally getting member swap is not particularly dangerous, as member swap will be one-arg while free swap is two-arg. &amp;nbsp;It's accidentally getting general swap that's dangerous, as it'll compile but run slowly.)&lt;/p&gt;
&lt;p&gt;I believe that Boost has their own swap wrapper for precisely this purpose.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8870886</link><pubDate>Sat, 16 Aug 2008 01:23:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8870886</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;[grokbrsm]&lt;/p&gt;
&lt;p&gt;&amp;gt; VC9 SP1: problems with tr1::function?&lt;/p&gt;
&lt;p&gt;A bazillion thanks for the bug report!&lt;/p&gt;
&lt;p&gt;I've confirmed this. The underlying problem is that when we implemented the Small Functor Optimization, tr1::function::swap() wasn't updated accordingly. This was broken in the Feature Pack, and no one noticed. But now that the Swaptimization works for vector&amp;lt;function&amp;lt;FT&amp;gt; &amp;gt;, that's broken too. Profoundly awful, as vector-of-function is so powerful.&lt;/p&gt;
&lt;p&gt;I'll file a bug and get this fixed in VC10.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8871391</link><pubDate>Sat, 16 Aug 2008 09:09:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8871391</guid><dc:creator>grokbrsm</dc:creator><description>&lt;p&gt;Well the SP1 problems with std::vector of tr1::function render tr1 almost useless as far as I am concerned, which is a shame since the integration of tr1 containers in the debugger is something I would not want to lose (therefore I would not like to use boost instead of the MSVC impl)... Is it possible to fix or work around the problem through a small modification of tr1 headers? If I understand correctly, all the tr1::function is implemented in headers. &lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8871713</link><pubDate>Sat, 16 Aug 2008 19:08:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8871713</guid><dc:creator>grokbrsm</dc:creator><description>&lt;p&gt;Well, I found a fix for the std::vector of tr1::function issue. in xxfunction, replace&lt;/p&gt;
&lt;p&gt;void _Swap(_Myt&amp;amp; _Right)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;(...)&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;by&lt;/p&gt;
&lt;p&gt;void _Swap(_Myt&amp;amp; _Right)&lt;/p&gt;
&lt;p&gt;{	// swap contents with contents of _Right&lt;/p&gt;
&lt;p&gt;bool _right_is_local = (void *)_Right._Impl == (void *)&amp;amp;_Right._Space;&lt;/p&gt;
&lt;p&gt;bool _this_is_local = (void *)_Impl == (void *)&amp;amp;_Space;&lt;/p&gt;
&lt;p&gt;if (_right_is_local || _this_is_local)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;_STD swap(_Space, _Right._Space);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;_Ptrt *_Timpl = _Right._Impl;&lt;/p&gt;
&lt;p&gt;_Right._Impl = _this_is_local?((_Ptrt *)&amp;amp;_Right._Space):_Impl;&lt;/p&gt;
&lt;p&gt;_Impl = _right_is_local?((_Ptrt *)&amp;amp;_Space):_Timpl;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I'd be glad to know if this really works as expected in every situation. &amp;nbsp;&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8877043</link><pubDate>Mon, 18 Aug 2008 22:11:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8877043</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;grokbrsm:&lt;/p&gt;
&lt;p&gt;&amp;gt; I'd be glad to know if this really works as expected in every situation.&lt;/p&gt;
&lt;p&gt;It doesn't. (A functor can own an object which has a pointer back to the functor.)&lt;/p&gt;
&lt;p&gt;We strongly advise against header-hacking, as it has the potential to make your Visual Studio installation unpatchable.&lt;/p&gt;
&lt;p&gt;There are a few things that you can do:&lt;/p&gt;
&lt;p&gt;1. Use boost::function. &amp;nbsp;It's not like tr1::function has a useful visualizer anyways. &amp;nbsp;(I wrote all of the TR1 visualizers, and they are as detailed as possible; unfortunately, the visualizer machinery can't see through a pointer-to-base, which is what powers tr1::function, so it's visualized with either &amp;quot;empty&amp;quot; or &amp;quot;full&amp;quot;.)&lt;/p&gt;
&lt;p&gt;2. Write a wrapper:&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;type meow.cpp&lt;/p&gt;
&lt;p&gt;#include &amp;lt;functional&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;iostream&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;ostream&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;vector&amp;gt;&lt;/p&gt;
&lt;p&gt;template &amp;lt;typename FT&amp;gt; struct fxn {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;fxn() : m_f() { }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;fxn(int) : m_f() { }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;template &amp;lt;typename F&amp;gt; fxn(F f) : m_f(f) { }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;fxn(const fxn&amp;amp; other) : m_f(other.m_f) { }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;fxn&amp;amp; operator=(int) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;m_f = 0;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return *this;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;template &amp;lt;typename F&amp;gt; fxn&amp;amp; operator=(F f) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;m_f = f;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return *this;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;fxn&amp;amp; operator=(const fxn&amp;amp; other) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;m_f = other.m_f;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return *this;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;std::tr1::function&amp;lt;FT&amp;gt; m_f;&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
&lt;p&gt;int add(int x, int y) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return x + y;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;int mult(int x, int y, int z) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return x * y * z;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;int main() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;using namespace std;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;using namespace std::tr1;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;using namespace std::tr1::placeholders;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;vector&amp;lt;fxn&amp;lt;int (int, int)&amp;gt; &amp;gt; v;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;v.push_back(add);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;v.push_back(bind(mult, _1, _2, 10));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;v.push_back(minus&amp;lt;int&amp;gt;());&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;for (vector&amp;lt;fxn&amp;lt;int (int, int)&amp;gt; &amp;gt;::const_iterator i = v.begin(); i != v.end(); ++i) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; i-&amp;gt;m_f(3, 4) &amp;lt;&amp;lt; endl;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;cl /EHsc /nologo /W4 meow.cpp&lt;/p&gt;
&lt;p&gt;meow.cpp&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;meow&lt;/p&gt;
&lt;p&gt;7&lt;/p&gt;
&lt;p&gt;120&lt;/p&gt;
&lt;p&gt;-1&lt;/p&gt;
&lt;p&gt;(This wrapper attempts to look like tr1::function for the purposes of construction and assignment, but otherwise requires you to use m_f.)&lt;/p&gt;
&lt;p&gt;3. Request a hotfix.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8877158</link><pubDate>Mon, 18 Aug 2008 23:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8877158</guid><dc:creator>grokbrsm</dc:creator><description>&lt;p&gt;&amp;gt; It doesn't. (A functor can own an object which has a pointer back to the functor.)&lt;/p&gt;
&lt;p&gt;Could you give a hint at when this can occur? If I understand correctly, in that case that pointer should be updated to point to the correct functor object, and obviously this does not happen with the code I posted.&lt;/p&gt;
&lt;p&gt;The wrapper trick works because it prevents the &amp;quot;swaptimization&amp;quot;?&lt;/p&gt;
&lt;p&gt;Thanks a lot for your detailed and insightful answers.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8877280</link><pubDate>Tue, 19 Aug 2008 00:43:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8877280</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;&amp;gt; Could you give a hint at when this can occur?&lt;/p&gt;
&lt;p&gt;That's just a pathological example that I thought up.&lt;/p&gt;
&lt;p&gt;&amp;gt; If I understand correctly, in that case that&lt;/p&gt;
&lt;p&gt;&amp;gt; pointer should be updated to point to the correct&lt;/p&gt;
&lt;p&gt;&amp;gt; functor object, and obviously this does not happen&lt;/p&gt;
&lt;p&gt;&amp;gt; with the code I posted.&lt;/p&gt;
&lt;p&gt;The problem is that your code is performing a bitwise copy of the stored functor, which can mangle non-PODs. To be truly correct, function::swap() must copy construct and destroy the stored functor. I now have a fix that does exactly this.&lt;/p&gt;
&lt;p&gt;&amp;gt; The wrapper trick works because it prevents&lt;/p&gt;
&lt;p&gt;&amp;gt; the &amp;quot;swaptimization&amp;quot;?&lt;/p&gt;
&lt;p&gt;Bingo.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8877422</link><pubDate>Tue, 19 Aug 2008 02:22:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8877422</guid><dc:creator>Michael Marcin</dc:creator><description>&lt;p&gt;I have some legacy code that uses boost::shared_ptr in std containers.&lt;/p&gt;
&lt;p&gt;Will I have to convert that to std::tr1::shared_ptr to get the vector realloc with no reference count manipulation or does it rely purely on adl and thus should work as is by choosing the boost::swap overload for shared_ptr?&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8877498</link><pubDate>Tue, 19 Aug 2008 03:07:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8877498</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;You'll either have to use tr1::shared_ptr, or partially specialize std::_Move_operation_category to annotate boost::shared_ptr as fast-swappable. There's no way to automatically detect fast-swappable types; they have to be annotated as such.&lt;/p&gt;
&lt;p&gt;(If you partially specialize std::_Move_operation_category, you'll want to do so as early as possible. 14.7.3/7: &amp;quot;When writing a specialization, be careful about its location; or to make it compile will be such a trial as to kindle its self-immolation.&amp;quot; If I were doing that, I'd forward-declare boost::shared_ptr and partially specialize std::_Move_operation_category at the top of my PCH, before anything else has a chance to instantiate vector&amp;lt;boost::shared_ptr&amp;lt;T&amp;gt; &amp;gt;.)&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8879621</link><pubDate>Tue, 19 Aug 2008 23:01:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8879621</guid><dc:creator>Pierre B.</dc:creator><description>&lt;p&gt;Wow! Very interesting. It's also very depressing that the chance of getting user-written template to work properly is very low. The amount of work-around needed to avoid all the gotchas of overloading, specialization, name lookup, makes it unlikely mere mortal can get it right.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8879662</link><pubDate>Tue, 19 Aug 2008 23:21:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8879662</guid><dc:creator>mikeb</dc:creator><description>&lt;p&gt;&amp;quot;will be such a trial as to kindle its self-immolation.&amp;quot;&lt;/p&gt;
&lt;p&gt;Haha - I thought for sure that you were paraphrasing the standard for effect. &amp;nbsp;But I see that &amp;quot;self-immolation&amp;quot; even made it into the index twice - once for &amp;quot;self-immolation&amp;quot;, and again for &amp;quot;immolation, self&amp;quot;!&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8879733</link><pubDate>Tue, 19 Aug 2008 23:54:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8879733</guid><dc:creator>Kris</dc:creator><description>&lt;p&gt;Great post. Last time I talked with you was in the nuwen IRC probably 5 years ago when you were about to leave to work on Outlook at MS. VC++ Library Developer? Nice.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8879777</link><pubDate>Wed, 20 Aug 2008 00:16:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8879777</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;Pierre B.:&lt;/p&gt;
&lt;p&gt;Actually, it's easy for users to use templates (including the Standard Library), and it's not terribly difficult to write templates with a moderate level of genericity.&lt;/p&gt;
&lt;p&gt;What's difficult is implementing the Standard Library - the trick here was picking up user-defined swaps, which is an extreme level of customizability.&lt;/p&gt;
&lt;p&gt;Note that the rules for getting your user-defined swaps to be picked up are easy: merely package them in the same namespace as your classes, which is the usual level of ADL cleanliness that you should be striving for (see Item 58 of C++ Coding Standards by Sutter and Alexandrescu for the full story).&lt;/p&gt;
&lt;p&gt;mikeb:&lt;/p&gt;
&lt;p&gt;Did you notice that it's a limerick? (I noticed the rhyming pattern when I first saw it, but didn't realize it was a limerick until someone else pointed it out to me.)&lt;/p&gt;
&lt;p&gt;Kris:&lt;/p&gt;
&lt;p&gt;Yup, I was an Outlook Search Dev in my former life, which I mentioned here: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/vcblog/archive/2007/02/26/stl-destructor-of-bugs.aspx"&gt;http://blogs.msdn.com/vcblog/archive/2007/02/26/stl-destructor-of-bugs.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8881037</link><pubDate>Wed, 20 Aug 2008 13:13:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8881037</guid><dc:creator>int19h</dc:creator><description>&lt;p&gt;&amp;gt; VC++ Library Developer? Nice.&lt;/p&gt;
&lt;p&gt;Well, with the name like that (or rather, initials), it's probably just his karma. I can't help but smile (in a good way) every time I see stl@microsoft.com - that's one 'leet email address! ;)&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8881799</link><pubDate>Wed, 20 Aug 2008 21:09:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8881799</guid><dc:creator>Michael Marcin</dc:creator><description>&lt;p&gt;How can I detect that I'm building on VC9 with SP1 installed using the preprocessor?&lt;/p&gt;
&lt;p&gt;I remember reading &lt;a rel="nofollow" target="_new" href="http://tinyurl.com/ys99kr"&gt;http://tinyurl.com/ys99kr&lt;/a&gt; which said that _MSC_BUILD would be used in the future to allow us to detect service pack versions but during this old blogging _MSC_BUILD for 2008 was 1 and it still is 1 for me with SP1 installed. I don't have a computer without SP1 installed to check against however.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8882209</link><pubDate>Wed, 20 Aug 2008 23:11:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8882209</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;Michael Marcin:&lt;/p&gt;
&lt;p&gt;_MSC_BUILD can be used to precisely identify the compiler version number, but it does not directly correspond to service pack level (i.e. it is NOT 0 for RTM, 1 for SP1, etc.).&lt;/p&gt;
&lt;p&gt;To summarize JonCaves' explanation:&lt;/p&gt;
&lt;p&gt;VC9 RTM's compiler version number was 15.00.21022.08. This is major.minor.build.minor-build. The major.minor version of 15.00 simply means &amp;quot;VC9&amp;quot;. The build version of 21022 corresponds to the daily build that was selected to become RTM. (This was 10/22/2007's build.) The minor-build version of 08 means that this build was &amp;quot;respun&amp;quot; 8 times to fix last-minute bugs. (Every daily build begins with a minor-build version of 00. During development, we typically generate new daily builds instead of respinning a specific build, so the minor-build version remains at 00 and is actually elided from cl's output. But for betas and official releases, we respin specific builds to gold-plate the bits, and typically the minor-build version is greater than 00.)&lt;/p&gt;
&lt;p&gt;_MSC_FULL_VER corresponds to major.minor.build, while _MSC_BUILD corresponds to minor-build (yes, the names are somewhat confusing - hence the blog post).&lt;/p&gt;
&lt;p&gt;VC8, which lacked _MSC_BUILD, had an RTM version number of 14.00.50727.42 and an SP1 version number of 14.00.50727.762. &amp;nbsp;Therefore, their _MSC_FULL_VER values were identical, and they were indistinguishable without resorting to trickery.&lt;/p&gt;
&lt;p&gt;We added _MSC_BUILD to prevent a recurrence of this.&lt;/p&gt;
&lt;p&gt;Now, to explain what you saw:&lt;/p&gt;
&lt;p&gt;VC9 Beta 2's version number was 15.00.20706.01.&lt;/p&gt;
&lt;p&gt;VC9 RTM's version number was 15.00.21022.08.&lt;/p&gt;
&lt;p&gt;VC9 SP1's version number is 15.00.30729.01.&lt;/p&gt;
&lt;p&gt;By coincidence, we respun Beta 2 and SP1 exactly once. That's why their minor-build numbers are identical.&lt;/p&gt;
&lt;p&gt;But unlike VC8, we increased SP1's build number (30729 indicates 7/29/2008's build). This is probably due to a change in our build process. So, _MSC_BUILD isn't actually needed to distinguish them.&lt;/p&gt;
&lt;p&gt;Here's the fully correct way to identify VC9 SP1 or above:&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;type meow.cpp&lt;/p&gt;
&lt;p&gt;#include &amp;lt;iostream&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;ostream&amp;gt;&lt;/p&gt;
&lt;p&gt;using namespace std;&lt;/p&gt;
&lt;p&gt;int main() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &amp;quot;_MSC_FULL_VER: &amp;quot; &amp;lt;&amp;lt; _MSC_FULL_VER &amp;lt;&amp;lt; endl;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &amp;quot;_MSC_BUILD: &amp;quot; &amp;lt;&amp;lt; _MSC_BUILD &amp;lt;&amp;lt; endl;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;#if defined(_MSC_VER) &amp;amp;&amp;amp; (_MSC_FULL_VER &amp;gt; 150021022 || _MSC_FULL_VER == 150021022 &amp;amp;&amp;amp; _MSC_BUILD &amp;gt;= 8)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &amp;quot;This is VC9 RTM or above.&amp;quot; &amp;lt;&amp;lt; endl;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;#endif&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;#if defined(_MSC_VER) &amp;amp;&amp;amp; (_MSC_FULL_VER &amp;gt; 150030729 || _MSC_FULL_VER == 150030729 &amp;amp;&amp;amp; _MSC_BUILD &amp;gt;= 1)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &amp;quot;This is VC9 SP1 or above.&amp;quot; &amp;lt;&amp;lt; endl;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;#endif&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;cl /EHsc /nologo /W4 meow.cpp&lt;/p&gt;
&lt;p&gt;meow.cpp&lt;/p&gt;
&lt;p&gt;With VC9 RTM:&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;meow&lt;/p&gt;
&lt;p&gt;_MSC_FULL_VER: 150021022&lt;/p&gt;
&lt;p&gt;_MSC_BUILD: 8&lt;/p&gt;
&lt;p&gt;This is VC9 RTM or above.&lt;/p&gt;
&lt;p&gt;With VC9 SP1:&lt;/p&gt;
&lt;p&gt;C:\Temp&amp;gt;meow&lt;/p&gt;
&lt;p&gt;_MSC_FULL_VER: 150030729&lt;/p&gt;
&lt;p&gt;_MSC_BUILD: 1&lt;/p&gt;
&lt;p&gt;This is VC9 RTM or above.&lt;/p&gt;
&lt;p&gt;This is VC9 SP1 or above.&lt;/p&gt;
&lt;p&gt;The cout &amp;lt;&amp;lt; &amp;quot;_MSC_BUILD: &amp;quot; &amp;lt;&amp;lt; _MSC_BUILD &amp;lt;&amp;lt; endl; line won't compile for VC8, but the #if tests will work correctly (without triggering warnings).&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8882405</link><pubDate>Thu, 21 Aug 2008 00:26:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8882405</guid><dc:creator>Michael Marcin</dc:creator><description>&lt;p&gt;Thank you for that detailed explanation.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8886134</link><pubDate>Fri, 22 Aug 2008 00:23:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8886134</guid><dc:creator>Niels Dekker</dc:creator><description>&lt;p&gt;Thanks for your information, Stephan!&lt;/p&gt;
&lt;p&gt;You wrote:&lt;/p&gt;
&lt;p&gt;&amp;gt; I believe that Boost has their own swap wrapper for precisely this purpose.&lt;/p&gt;
&lt;p&gt;FYI, Boost's swap utility isn't yet officially released, but it's available at &lt;a rel="nofollow" target="_new" href="https://svn.boost.org/svn/boost/trunk/boost/utility/swap.hpp"&gt;https://svn.boost.org/svn/boost/trunk/boost/utility/swap.hpp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See also &lt;a rel="nofollow" target="_new" href="https://svn.boost.org/svn/boost/trunk/libs/utility/swap.html"&gt;https://svn.boost.org/svn/boost/trunk/libs/utility/swap.html&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>How to tweak Swaptimization in a generic way?</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8890263</link><pubDate>Sat, 23 Aug 2008 13:56:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8890263</guid><dc:creator>Niels Dekker</dc:creator><description>&lt;p&gt;Would it be okay to tweak this &amp;quot;Swaptimization&amp;quot; by defining the macro _DEFAULT_MOVE_OPERATION_CATEGORY in a different way than &amp;lt;xutility&amp;gt; does? It looks to me that in general, the penalty of copying, when swapping is preferable, is much higher than the penalty of swapping, when copying is preferable. So would it be okay to change the default, by adding the following command line argument to the compiler? &amp;nbsp;/D &amp;quot;_DEFAULT_MOVE_OPERATION_CATEGORY=_Swap_move_tag&amp;quot;&lt;/p&gt;
&lt;p&gt;STL wrote: &amp;quot;There's no way to automatically detect fast-swappable types&amp;quot;&lt;/p&gt;
&lt;p&gt;A type that has its own swap overload is usually fast-swappable. David Abrahams has actually just posted a has_swap_overload&amp;lt;T&amp;gt; metafunction at &lt;a rel="nofollow" target="_new" href="http://lists.boost.org/Archives/boost/2008/08/141334.php"&gt;http://lists.boost.org/Archives/boost/2008/08/141334.php&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ideally, Swaptimization should be applied to type T by default, if-and-only-if T has its own swap overload. Right? Could a metafunction like has_swap_overload&amp;lt;T&amp;gt; be used to tweak Swaptimization in a more generic way? &lt;/p&gt;
</description></item><item><title>TR1 for Windows Mobile projects</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8893678</link><pubDate>Mon, 25 Aug 2008 13:46:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8893678</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Windows Mobile projects in VC9 configured to use &amp;quot;ce\include&amp;quot; folder with different version of STL and without TR1 additions available in regular &amp;quot;include&amp;quot; folder.&lt;/p&gt;
&lt;p&gt;Does this mean that TR1 one is not supported on Windows Mobile projects in VC9?&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8894563</link><pubDate>Mon, 25 Aug 2008 21:18:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8894563</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;[Niels Dekker]&lt;/p&gt;
&lt;p&gt;&amp;gt; Would it be okay to tweak this &amp;quot;Swaptimization&amp;quot; by defining the macro _DEFAULT_MOVE_OPERATION_CATEGORY in a different way than &amp;lt;xutility&amp;gt; does?&lt;/p&gt;
&lt;p&gt;No. That would break some code, and slow down some other code.&lt;/p&gt;
&lt;p&gt;The Swaptimization requires a default constructor, but the STL does not. Activating the Swaptimization for all types would therefore break containers of types without default constructors.&lt;/p&gt;
&lt;p&gt;Furthermore, swapping is slower than copying for PODs. Slowing down vector&amp;lt;unsigned char&amp;gt; is bad news indeed.&lt;/p&gt;
&lt;p&gt;_DEFAULT_MOVE_OPERATION_CATEGORY shouldn't be a macro in the first place; it is not a point of customization.&lt;/p&gt;
&lt;p&gt;&amp;gt; Ideally, Swaptimization should be applied to type T by default, if-and-only-if T has its own swap overload. Right?&lt;/p&gt;
&lt;p&gt;According to my understanding, there is no way to detect explicit specializations of std::swap (as opposed to overloads in another namespace).&lt;/p&gt;
&lt;p&gt;&amp;gt; Could a metafunction like has_swap_overload&amp;lt;T&amp;gt; be used to tweak Swaptimization in a more generic way?&lt;/p&gt;
&lt;p&gt;This question is (happily) moot due to rvalue references.&lt;/p&gt;
&lt;p&gt;[Alex]&lt;/p&gt;
&lt;p&gt;&amp;gt; Windows Mobile projects in VC9 configured to use &amp;quot;ce\include&amp;quot; folder with different version of STL and without TR1 additions available in regular &amp;quot;include&amp;quot; folder.&lt;/p&gt;
&lt;p&gt;&amp;gt; Does this mean that TR1 one is not supported on Windows Mobile projects in VC9?&lt;/p&gt;
&lt;p&gt;CE's STL is maintained by an entirely different team, like the X360.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8899466</link><pubDate>Wed, 27 Aug 2008 12:43:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8899466</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;&amp;gt; CE's STL is maintained by an entirely different team, like the X360.&lt;/p&gt;
&lt;p&gt;Why? Compiler front end is the same. What's the problem?&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8901459</link><pubDate>Wed, 27 Aug 2008 23:49:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8901459</guid><dc:creator>Niels Dekker</dc:creator><description>&lt;p&gt;STL wrote: &amp;quot;The Swaptimization requires a default constructor, but the STL does not&amp;quot;&lt;/p&gt;
&lt;p&gt;Thanks for reminding me! :-) Does VC 9 provide a way to estimate whether a type is default-constructible?&lt;/p&gt;
&lt;p&gt;&amp;quot;Furthermore, swapping is slower than copying for PODs. Slowing down vector&amp;lt;unsigned char&amp;gt; is bad news indeed.&amp;quot;&lt;/p&gt;
&lt;p&gt;Okay. But now I may have found a bug in \VC\include\array. It has a _Move_operation_category&amp;lt;tr1::array&amp;lt;_Ty,_Size&amp;gt;&amp;gt; specialization, having &amp;quot;typedef _Swap_move_tag _Move_cat&amp;quot;. Which activates Swaptimization for an array of PODs, right? I think that tr1::array&amp;lt;_Ty,_Size&amp;gt; should only be &amp;quot;swaptimized&amp;quot; whenever _Ty itself is &amp;quot;swaptimized&amp;quot;. So _Move_operation_category&amp;lt;tr1::array&amp;lt;_Ty,_Size&amp;gt;&amp;gt; should have:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;typedef typename _Move_operation_category&amp;lt;_Ty&amp;gt;::_Move_cat _Move_cat;&lt;/p&gt;
&lt;p&gt;Don't you think? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;_DEFAULT_MOVE_OPERATION_CATEGORY shouldn't be a macro in the first place; it is not a point of customization.&amp;quot;&lt;/p&gt;
&lt;p&gt;Unfortunately. Anyway, in &amp;quot;STL-implementation independent code&amp;quot;, it does at least provide a simple way to check if the STL supports &amp;nbsp;Swaptimization, by doing #ifdef _DEFAULT_MOVE_OPERATION_CATEGORY. (Right?) Which could be helpful to activate Swaptimization within &amp;nbsp;Boost, as we're discussing at &amp;quot;[boost] Enabling fast swap optimization for Boost types VC9 SP1.&amp;quot;, &lt;a rel="nofollow" target="_new" href="http://thread.gmane.org/gmane.comp.lib.boost.devel/178944"&gt;http://thread.gmane.org/gmane.comp.lib.boost.devel/178944&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks again!&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8901695</link><pubDate>Thu, 28 Aug 2008 01:23:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8901695</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;[Niels Dekker]&lt;/p&gt;
&lt;p&gt;&amp;gt; Does VC 9 provide a way to estimate whether a type is default-constructible?&lt;/p&gt;
&lt;p&gt;TR1 doesn't contain such a type trait. (has_trivial_constructor and has_nothrow_constructor have been renamed to has_trivial_default_constructor and has_nothrow_default_constructor in C++0x, but there is no has_default_constructor.)&lt;/p&gt;
&lt;p&gt;I don't know whether has_default_constructor can be implemented in plain C++.&lt;/p&gt;
&lt;p&gt;&amp;gt; I think that tr1::array&amp;lt;_Ty,_Size&amp;gt; should only be &amp;quot;swaptimized&amp;quot; whenever _Ty itself is &amp;quot;swaptimized&amp;quot;.&lt;/p&gt;
&lt;p&gt;Correct. This was my oversight. That makes three instances of Swaptimization-related borkage so far (sigh). But at least vector&amp;lt;shared_ptr&amp;lt;T&amp;gt; &amp;gt; is fast!&lt;/p&gt;
&lt;p&gt;&amp;gt; Anyway, in &amp;quot;STL-implementation independent code&amp;quot;, it does at least provide&lt;/p&gt;
&lt;p&gt;&amp;gt; a simple way to check if the STL supports &amp;nbsp;Swaptimization, by doing #ifdef&lt;/p&gt;
&lt;p&gt;&amp;gt; _DEFAULT_MOVE_OPERATION_CATEGORY. (Right?)&lt;/p&gt;
&lt;p&gt;Incorrect. &amp;nbsp;This macro existed in VC9 RTM (and VC8, IIRC), but the Swaptimization was fixed to work for types other than those directly within namespace std only in VC9 SP1.&lt;/p&gt;
&lt;p&gt;&amp;gt; Which could be helpful to activate Swaptimization within Boost&lt;/p&gt;
&lt;p&gt;As I posted above, here's how to do it:&lt;/p&gt;
&lt;p&gt;// Specific to VC9 SP1 and above.&lt;/p&gt;
&lt;p&gt;// This machinery was broken for classes outside namespace std in VC9 RTM and below.&lt;/p&gt;
&lt;p&gt;// This machinery will not be present in VC10 and above.&lt;/p&gt;
&lt;p&gt;#if defined(_MSC_VER) &amp;amp;&amp;amp; _MSC_VER == 1500 &amp;amp;&amp;amp; _MSC_FULL_VER &amp;gt;= 150030729&lt;/p&gt;
&lt;p&gt; &amp;nbsp; #include &amp;lt;xutility&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; namespace std {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; template &amp;lt;&amp;gt; class _Move_operation_category&amp;lt;feline::kitty&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; public:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; typedef _Swap_move_tag _Move_cat;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;#endif&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8902933</link><pubDate>Thu, 28 Aug 2008 09:28:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8902933</guid><dc:creator>SvenC</dc:creator><description>&lt;p&gt;Stephan, I was pretty sure that you are really good at what you do. And with your last statement you proved it again: you are so good that you have no problems to openly tell when you do not know something (the has_default_constructor question). I like that and feel that STL is in good hands for VC++! Thanks, SvenC&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8904008</link><pubDate>Thu, 28 Aug 2008 22:37:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8904008</guid><dc:creator>Niels Dekker</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; I think that tr1::array&amp;lt;_Ty,_Size&amp;gt; should only be &amp;quot;swaptimized&amp;quot; whenever _Ty itself is &amp;quot;swaptimized&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;gt; Correct. This was my oversight.&lt;/p&gt;
&lt;p&gt;Would it be helpful if I'd submit the tr1::array&amp;lt;_Ty,_Size&amp;gt; Swaptimization issue to Microsoft Connect? &lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8904077</link><pubDate>Thu, 28 Aug 2008 23:14:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8904077</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;SvenC: The more one works with C++, the more reluctant one becomes about saying &amp;quot;X can't be done in C++&amp;quot;. &amp;nbsp;:-)&lt;/p&gt;
&lt;p&gt;Niels Dekker: Not especially, as this machinery is being ripped out in VC10. I'll see if we can hotfix function::swap() and the pair/tuple/array annotations simultaneously.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8904182</link><pubDate>Fri, 29 Aug 2008 00:21:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8904182</guid><dc:creator>Niels Dekker</dc:creator><description>&lt;p&gt;&amp;gt; I'll see if we can hotfix function::swap() and the pair/tuple/array annotations simultaneously.&lt;/p&gt;
&lt;p&gt;It's not entirely clear to me what's wrong about the pair/tuple annotations... Do you mean that MSVC's std::pair and tr1::tuple now accidentally require all of their template arguments to be DefaultConstructible, if only one of them is activated for Swaptimization?&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8904337</link><pubDate>Fri, 29 Aug 2008 02:54:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8904337</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;Yes, which breaks conformant code, which is bad. The annotation is correct from a performance perspective, but we forgot that the Swaptimization has the additional requirement of a default constructor.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8925191</link><pubDate>Fri, 05 Sep 2008 00:02:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8925191</guid><dc:creator>Niels Dekker</dc:creator><description>&lt;p&gt;Can you please give an indication of when this &amp;quot;swap hotfix&amp;quot; would be available? At my work (www.lkeb.nl), it is planned to apply SP1 later this month. (We're using VC9.) Would you recommend waiting for the hotfix before applying SP1? Please also provide a way to distinguish between a hotfixed and a non-hotfixed installation, by means of a macro or version number. &lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8935100</link><pubDate>Tue, 09 Sep 2008 01:43:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8935100</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;[Niels Dekker]&lt;/p&gt;
&lt;p&gt;&amp;gt; Can you please give an indication of when&lt;/p&gt;
&lt;p&gt;&amp;gt; this &amp;quot;swap hotfix&amp;quot; would be available?&lt;/p&gt;
&lt;p&gt;Not yet. I can't even promise that we'll ship a hotfix (although I certainly want to).&lt;/p&gt;
&lt;p&gt;&amp;gt; At my work (www.lkeb.nl), it is planned to apply&lt;/p&gt;
&lt;p&gt;&amp;gt; SP1 later this month. (We're using VC9.) Would you&lt;/p&gt;
&lt;p&gt;&amp;gt; recommend waiting for the hotfix before applying&lt;/p&gt;
&lt;p&gt;&amp;gt; SP1?&lt;/p&gt;
&lt;p&gt;If you're using VC9 RTM, then you can upgrade to VC9 SP1. (The only known regression there is vector&amp;lt;pair&amp;lt;no-default-ctor, something-fast-swappable&amp;gt; &amp;gt;.)&lt;/p&gt;
&lt;p&gt;If you're using VC9 Feature Pack Refresh, then you can upgrade to VC9 SP1 if you're not yet using vector&amp;lt;function&amp;lt;FT&amp;gt; &amp;gt;. &amp;nbsp;If you are, then you'll be hit by this bug, and you'll either need to use a workaround or hold off on upgrading to VC9 SP1.&lt;/p&gt;
&lt;p&gt;&amp;gt; Please also provide a way to distinguish between a&lt;/p&gt;
&lt;p&gt;&amp;gt; hotfixed and a non-hotfixed installation, by means&lt;/p&gt;
&lt;p&gt;&amp;gt; of a macro or version number.&lt;/p&gt;
&lt;p&gt;_MSC_FULL_VER and _MSC_BUILD completely identify the compiler version. I believe that the compiler version would be incremented for such a hotfix, but I'm not sure. If we simultaneously hotfix the function::swap(), pair/tuple, and array issues, then the hotfix will certainly be identifiable by looking at how pair, tuple, or array is annotated.&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8957705</link><pubDate>Thu, 18 Sep 2008 21:44:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8957705</guid><dc:creator>CMWoods</dc:creator><description>&lt;p&gt;Any update on whether the team has decided whether or not a hotfix (or better) to address these various issues will be made?&lt;/p&gt;
</description></item><item><title>re: TR1 Fixes In VC9 SP1</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#8959616</link><pubDate>Sat, 20 Sep 2008 03:20:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8959616</guid><dc:creator>Stephan T. Lavavej [MSFT]</dc:creator><description>&lt;p&gt;No promises, but Magic 8-Ball says: Signs point to yes.&lt;/p&gt;
&lt;p&gt;I merged (function) and wrote (pair, tuple, array, random) the fixes last night, in my pajamas, in about 5 minutes. The other steps of the hotfix process will take longer.&lt;/p&gt;
&lt;p&gt;We write VCBlog posts when hotfixes are publicly available, like we did for the Intellisense hotfix, so stay tuned.&lt;/p&gt;
</description></item><item><title>VC9 SP1 Hotfix For The vector&lt;function&lt;FT&gt;&gt; Crash</title><link>http://blogs.msdn.com/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx#9231155</link><pubDate>Wed, 17 Dec 2008 20:05:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9231155</guid><dc:creator>Visual C++ Team Blog</dc:creator><description>&lt;p&gt;Back in August, I blogged about the TR1 fixes in VC9 SP1 . An observant reader, grokbrsm, commented that&lt;/p&gt;
</description></item></channel></rss>