<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 - Discussions by KerrekSB</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 - Discussions by KerrekSB</title>
		<link>http://channel9.msdn.com/Niners/KerrekSB/Discussions</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Niners/KerrekSB/Discussions</link>
	<language>en</language>
	<pubDate>Sun, 19 May 2013 15:05:05 GMT</pubDate>
	<lastBuildDate>Sun, 19 May 2013 15:05:05 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>0</c9:totalResults>
	<c9:pageCount>0</c9:pageCount>
	<c9:pageSize>0</c9:pageSize>
	<item>
		<title>Tech Off - Advanced STL topics</title>
		<description><![CDATA[<p>I think we've gone on for too long without STL's show! <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /> How about we post a few ideas for things we'd like to know and see if STL finds any of them interesting?</p><p>I'll make a start:</p><ul><li>Implementation of <code>std::function</code> and <code>std::bind</code>. This could be similar to the talk on <code>std::shared_ptr</code>. </li><li>Concurrency-related: <code>&lt;thread&gt;</code>, <code>&lt;future&gt;</code>, <code>&lt;async&gt;</code>. </li><li>I think STL mentioned that VS11 would have new features pertaining to allocator support; if that's mature already, that could be worth talking about. </li></ul><p>What do you think? Any favourite topics that come to mind?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Advanced-STL-topics/ee42cbd210a041b0b5919fa7001271e0#ee42cbd210a041b0b5919fa7001271e0</link>
		<pubDate>Sat, 26 Nov 2011 01:07:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Advanced-STL-topics/ee42cbd210a041b0b5919fa7001271e0#ee42cbd210a041b0b5919fa7001271e0</guid>
		<dc:creator>KerrekSB</dc:creator>
		<slash:comments>10</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Templated STL container pretty printer</title>
		<description><![CDATA[<p>Interesting. Indeed, you're not supposed to derive from most STL classes, but I see your point... a derived class with iterators whose base class already implements an output operator. Hm, well, I guess I'm not too worried about that, but perhaps there's some is_base-typetrait magic that could detect such cases? For that matter, is there a typetrait that checks whether a particular member function exists?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/b560911fe7c34b3889999efa0127a3ed#b560911fe7c34b3889999efa0127a3ed</link>
		<pubDate>Mon, 06 Jun 2011 17:56:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/b560911fe7c34b3889999efa0127a3ed#b560911fe7c34b3889999efa0127a3ed</guid>
		<dc:creator>KerrekSB</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Templated STL container pretty printer</title>
		<description><![CDATA[<p>Oh, thank you! I wasn't sure how to name various things, please let me know if anything else should be cleaner.</p><p>By the way, you were missing the last template parameter in the operator with the print_container_helper argument. I'll update my modified code (and add an example of custom delimiters), but I wanted to let you know.</p><p>I'd also like to use some template aliases for char- and wchar_t delimiter classes a la &quot;template&lt;typename T&gt; using sdelims = delimiters&lt;T, char&gt;. Shame my GCC4.4 doesn't seem to understand.</p><p>Finally, I want to get a generic outputter for std::tuple, too, like we have for pair; now trying to work through variadic templates...</p><p><em>Edit:</em> I just added a C array wrapper, check out my updated code on SO!</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/8d59e812526544f4b5519ef901204bfc#8d59e812526544f4b5519ef901204bfc</link>
		<pubDate>Sun, 05 Jun 2011 17:29:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/8d59e812526544f4b5519ef901204bfc#8d59e812526544f4b5519ef901204bfc</guid>
		<dc:creator>KerrekSB</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Templated STL container pretty printer</title>
		<description><![CDATA[<p>Sure, if you find a situation were this breaks stuff, we should try to think about it, but for now I'm finding this tremendously useful.</p><p>The only problem I can see is if you try to directly stream-out an object of a class for which you haven't defined an operator and which have iterators -- if you did have an overloaded operator, it would take precedence, and if you didn't and don't want it to be used like this, then you shouldn't write &quot;cout &lt;&lt; x&quot;. So... I really can't think of a way in which our templates would break an existing program. Please do tell if you have an example!</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/4f236c376a7a49d0829c9ef900c0ceec#4f236c376a7a49d0829c9ef900c0ceec</link>
		<pubDate>Sun, 05 Jun 2011 11:41:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/4f236c376a7a49d0829c9ef900c0ceec#4f236c376a7a49d0829c9ef900c0ceec</guid>
		<dc:creator>KerrekSB</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Templated STL container pretty printer</title>
		<description><![CDATA[<p>Alright, I think we may be onto something. If we check for the presence of value_type first, and then also for the existence of begin()/end() _and_ const_iterator, what else could go wrong?</p><p>Edit:</p>I've tested a bit and it seems that with my SFINAE is_container trait everything works well, even in the presence of strings. This is great. Should we publish it somewhere? You should definitely post this on SO so I can give you an &quot;accept&quot;. Perhaps we could send a copy to STL? <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' />]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/4381fb7260f04775842e9ef801142efe#4381fb7260f04775842e9ef801142efe</link>
		<pubDate>Sat, 04 Jun 2011 16:45:33 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/4381fb7260f04775842e9ef801142efe#4381fb7260f04775842e9ef801142efe</guid>
		<dc:creator>KerrekSB</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Templated STL container pretty printer</title>
		<description><![CDATA[<p>@<a href="/Forums/TechOff/Templated-STL-container-pretty-printer#c2c75b5241ef14956818e9ef801116a65">Sven Groot</a>: Thanks, but I think I just discovered a way to use SFINAE to detect the presence of iterators (see my edit above), so hopefully I can completely avoid mentioning any explicit container types altogether.</p><p>Bonus question: Can we SFINAE between &quot;*iterator == pair&lt;K,V&gt;&quot; and &quot;*iterator == T&quot;?</p><p>Edit: I see your point about the string class, but wouldn't the string's operator&lt;&lt; be more specialized?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/ad7e0e732f5b4486a1f39ef801121dc0#ad7e0e732f5b4486a1f39ef801121dc0</link>
		<pubDate>Sat, 04 Jun 2011 16:38:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/ad7e0e732f5b4486a1f39ef801121dc0#ad7e0e732f5b4486a1f39ef801121dc0</guid>
		<dc:creator>KerrekSB</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Templated STL container pretty printer</title>
		<description><![CDATA[<p>That is genius, brilliant! If you post the solution on SO, I will accept it as the answer! I haven't read it closely yet, but I'm excited to find out how you did this.</p><p><del>One thing, though: Can we add associative container support to print a map like &quot;{1: hello, 2: world, 3: foobar}&quot;?</del> Oh, I see that it works for maps, but not for unordered_maps. Does the code require explicit predeclaration of all supported container types? Perhaps that could be wrapped into a macro for the client code...</p><p>Maybe we can use SFINAE to determined automagically whether a class supports ::begin() and ::end()?!</p><p><strong>Edit:</strong> I think I have made a trait class to detect the presence of iterators!</p><p>&nbsp;</p><p><pre class="brush: cpp">template&lt;typename T&gt;
struct mycont_helper
{
private:
  template&lt;typename C&gt; static char test(typename C::iterator*);
  template&lt;typename C&gt; static int  test(...);
public:
  static const bool __value = sizeof(test&lt;T&gt;(0)) == sizeof(char);
};

template&lt;typename T&gt;
struct mycont : public std::integral_constant&lt;bool, mycont_helper&lt;T&gt;::__value&gt;
{ };</pre></p><p>Usage: mycont&amp;lt;T&amp;gt;::value will be true for containers and false otherwise.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/e215b16855ac444d9a4f9ef801032a25#e215b16855ac444d9a4f9ef801032a25</link>
		<pubDate>Sat, 04 Jun 2011 15:43:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/e215b16855ac444d9a4f9ef801032a25#e215b16855ac444d9a4f9ef801032a25</guid>
		<dc:creator>KerrekSB</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Templated STL container pretty printer</title>
		<description><![CDATA[<p>I see -- OK, overloading &lt;&lt; isn't necessary, as long as I can say something like &quot;std::cout &lt;&lt; &quot;My vector is &quot; &lt;&lt; PrintContainer(vec) &lt;&lt; &quot;.\n&quot; without having to touch the definition of PrintContainer in the future.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/8d385874155f4e73b4469ef6002c4305#8d385874155f4e73b4469ef6002c4305</link>
		<pubDate>Thu, 02 Jun 2011 02:41:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/8d385874155f4e73b4469ef6002c4305#8d385874155f4e73b4469ef6002c4305</guid>
		<dc:creator>KerrekSB</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Templated STL container pretty printer</title>
		<description><![CDATA[<p>[Preface: I just discovered and watched STL's series &quot;STL&quot; and &quot;Advanced STL&quot;. In response to STL#2's homework question to create a template to erase predicated elements from a container, I'd like to post a similar &quot;homework&quot; question.]</p><p><em>Task:</em> Write a templated solution that will pretty-print the contents of any STL container, or more generally anything that supports begin/end iterators.</p><p>I originally posted this question on StackOverflow (<a href="http://stackoverflow.com/questions/4850473/pretty-print-c-stl-containers">http&#58;&#47;&#47;stackoverflow.com&#47;questions&#47;4850473&#47;pretty-print-c-stl-containers</a>), but looking back at it I'm still not happy with any of the proposed solutions.</p><p><em>Synopsis:</em> Given something like std::CONTAINER x, I want to write &quot;std::cout &lt;&lt; x;&quot; and get something like &quot;{1, 5, -3, 12}&quot; (with customizable delimiters), but I don't want to have to change the code to accomodate new containers -- I'd like a single piece of code that will work for ALL containers that have begin/end.</p><p>Any suggestions (also to the original SO page) would be most welcome!</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/f60e1d38d6744aeaa18b9ef501694b07#f60e1d38d6744aeaa18b9ef501694b07</link>
		<pubDate>Wed, 01 Jun 2011 21:55:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Templated-STL-container-pretty-printer/f60e1d38d6744aeaa18b9ef501694b07#f60e1d38d6744aeaa18b9ef501694b07</guid>
		<dc:creator>KerrekSB</dc:creator>
		<slash:comments>17</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/KerrekSB/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>