{"id":2313,"date":"2012-07-16T14:16:00","date_gmt":"2012-07-16T14:16:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2012\/07\/16\/template-argument-deduction-core-c-part-2\/"},"modified":"2019-02-18T18:41:38","modified_gmt":"2019-02-18T18:41:38","slug":"template-argument-deduction-core-c-part-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/template-argument-deduction-core-c-part-2\/","title":{"rendered":"Template Argument Deduction &#8211; Core C++, Part 2"},"content":{"rendered":"<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Core-C-\/Stephan-T-Lavavej-Core-C-2-of-n\"><span style=\"color: #0000ff\">Part 2<\/span><\/a> of my third video lecture series (covering the C++ Core Language) is now available.&nbsp; In this part, I took an hour to explore template argument deduction, including what &#8220;non-deduced contexts&#8221; are &#8211; and how they can be used to your advantage!&nbsp; For reference, here are all of the links to my video lectures, plus my GoingNative 2012 presentation:<\/p>\n<p>&nbsp;<\/p>\n<p>[STL Introduction]<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Introduction-to-STL-with-Stephan-T-Lavavej\"><span style=\"color: #0000ff\">Part 1<\/span><\/a> (sequence containers)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-2-of-n\"><span style=\"color: #0000ff\">Part 2<\/span><\/a> (associative containers)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-3-of-n\"><span style=\"color: #0000ff\">Part 3<\/span><\/a> (smart pointers)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-4-of-n\"><span style=\"color: #0000ff\">Part 4<\/span><\/a> (Nurikabe solver) &#8211; see Wikipedia&#8217;s <a href=\"http:\/\/en.wikipedia.org\/wiki\/Nurikabe\"><span style=\"color: #0000ff\">article<\/span><\/a> and my <a href=\"http:\/\/sdrv.ms\/Naz62Q\"><span style=\"color: #0000ff\">updated source code<\/span><\/a><\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-5-of-n\"><span style=\"color: #0000ff\">Part 5<\/span><\/a> (Nurikabe solver, continued)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-6-of-n\"><span style=\"color: #0000ff\">Part 6<\/span><\/a> (algorithms and functors)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-7-of-n\"><span style=\"color: #0000ff\">Part 7<\/span><\/a> (algorithms and functors, continued)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-8-of-n\"><span style=\"color: #0000ff\">Part 8<\/span><\/a> (regular expressions)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-9-of-n\"><span style=\"color: #0000ff\">Part 9<\/span><\/a> (rvalue references)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-10-of-10\"><span style=\"color: #0000ff\">Part 10<\/span><\/a> (type traits)<\/p>\n<p>&nbsp;<\/p>\n<p>[Advanced STL]<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-1-of-n\"><span style=\"color: #0000ff\">Part 1<\/span><\/a> (shared_ptr &#8211; type erasure)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-2-of-n\"><span style=\"color: #0000ff\">Part 2<\/span><\/a> (equal()\/copy() &#8211; algorithm optimizations)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-3-of-n\"><span style=\"color: #0000ff\">Part 3<\/span><\/a> (_ITERATOR_DEBUG_LEVEL, #pragma detect_mismatch, and \/d1reportSingleClassLayout)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-4-of-n\"><span style=\"color: #0000ff\">Part 4<\/span><\/a> (rvalue references v2.1 and associative container mischief)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-5-of-n\"><span style=\"color: #0000ff\">Part 5<\/span><\/a> (deduplicator, using Boost.<a href=\"http:\/\/www.boost.org\/doc\/libs\/release\/libs\/bimap\/\"><span style=\"color: #0000ff\">Bimap<\/span><\/a>, <a href=\"http:\/\/www.boost.org\/doc\/libs\/release\/libs\/filesystem\/\"><span style=\"color: #0000ff\">Filesystem<\/span><\/a>, and <a href=\"http:\/\/www.boost.org\/doc\/libs\/release\/libs\/scope_exit\/\"><span style=\"color: #0000ff\">ScopeExit<\/span><\/a>) &#8211; see my <a href=\"http:\/\/sdrv.ms\/LJTjtt\"><span style=\"color: #0000ff\">deduplicate.cpp<\/span><\/a><\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-6-of-n\"><span style=\"color: #0000ff\">Part 6<\/span><\/a> (container pretty printer) &#8211; see my <a href=\"http:\/\/sdrv.ms\/LYWDn3\"><span style=\"color: #0000ff\">pretty_printer.cpp<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>[GoingNative 2012]<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Events\/GoingNative\/GoingNative-2012\/STL11-Magic-Secrets\"><span style=\"color: #0000ff\">STL11: Magic &amp;&amp; Secrets<\/span><\/a> (make_shared&lt;T&gt;(), emplacement, pair SFINAE, <b>range-based for-loop<\/b>) &#8211; see my <a href=\"http:\/\/view.officeapps.live.com\/op\/view.aspx?src=http%3a%2f%2fecn.channel9.msdn.com%2fevents%2fGoingNative12%2fGN12STL11.pptx\"><span style=\"color: #0000ff\">slides<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>[Core C++]<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Core-C-\/Stephan-T-Lavavej-Core-C-1-of-n\"><span style=\"color: #0000ff\">Part 1<\/span><\/a> (name lookup)<\/p>\n<p><a href=\"https:\/\/channel9.msdn.com\/Series\/C9-Lectures-Stephan-T-Lavavej-Core-C-\/Stephan-T-Lavavej-Core-C-2-of-n\"><span style=\"color: #0000ff\">Part 2<\/span><\/a> (template argument deduction)<\/p>\n<p>&nbsp;<\/p>\n<p>Stephan T. Lavavej<\/p>\n<p>Senior Developer &#8211; Visual C++ Libraries<\/p>\n<p><a href=\"mailto:stl@microsoft.com\"><span style=\"color: #0000ff\">stl@microsoft.com<\/span><\/a><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part 2 of my third video lecture series (covering the C++ Core Language) is now available.&nbsp; In this part, I took an hour to explore template argument deduction, including what &#8220;non-deduced contexts&#8221; are &#8211; and how they can be used to your advantage!&nbsp; For reference, here are all of the links to my video lectures, [&hellip;]<\/p>\n","protected":false},"author":289,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[9,32],"class_list":["post-2313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-channel-9","tag-stl"],"acf":[],"blog_post_summary":"<p>Part 2 of my third video lecture series (covering the C++ Core Language) is now available.&nbsp; In this part, I took an hour to explore template argument deduction, including what &#8220;non-deduced contexts&#8221; are &#8211; and how they can be used to your advantage!&nbsp; For reference, here are all of the links to my video lectures, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/2313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/289"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=2313"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/2313\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=2313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=2313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=2313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}