{"id":3193,"date":"2011-04-05T13:50:00","date_gmt":"2011-04-05T13:50:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2011\/04\/05\/_iterator_debug_level-advanced-stl-part-3\/"},"modified":"2019-02-18T18:45:03","modified_gmt":"2019-02-18T18:45:03","slug":"_iterator_debug_level-advanced-stl-part-3","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/_iterator_debug_level-advanced-stl-part-3\/","title":{"rendered":"_ITERATOR_DEBUG_LEVEL &#8211; Advanced STL, Part 3"},"content":{"rendered":"<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><span style=\"font-size: small\">In <\/span><a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-3-of-n\"><span style=\"color: #0000ff;font-size: small\">Part 3<\/span><\/a><span style=\"font-size: small\"> of my video lecture series exploring the Standard Template Library&#8217;s implementation, I explain how our powerful correctness checks in debug mode work.&nbsp; In VC10, they&#8217;re controlled by the macro _ITERATOR_DEBUG_LEVEL, which supersedes VC8 and VC9&#8217;s more confusing _SECURE_SCL and _HAS_ITERATOR_DEBUGGING macros.&nbsp; Additionally, VC10&#8217;s #pragma detect_mismatch allows the linker to detect badness that previously would have caused incomprehensible crashes.&nbsp; Finally, I demonstrate the undocumented and unsupported but exceedingly awesome compiler option \/d1reportSingleClassLayout which prints an ASCII art diagram of a class&#8217;s representation.<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-size: small\"><span style=\"font-family: 'Verdana','sans-serif'\">&nbsp;<\/span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-size: small\"><span style=\"font-family: 'Verdana','sans-serif'\">This advanced series assumes that you&#8217;re familiar with C++ and the STL&#8217;s interface, but not the STL&#8217;s implementation.&nbsp; If you haven&#8217;t used the STL extensively yet, I recommend watching my introductory series.&nbsp; For reference, here are all of the links:<\/span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\">\n<p><span style=\"font-family: Times New Roman;font-size: small\">&nbsp;<\/span><\/p>\n<\/p>\n<p class=\"MsoNormal\"><span style=\"font-size: small\"><span style=\"font-family: 'Verdana','sans-serif'\">[STL Introduction]<\/span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/shows\/Going+Deep\/C9-Lectures-Introduction-to-STL-with-Stephan-T-Lavavej\/\"><span style=\"color: #0000ff;font-size: small\">Part 1<\/span><\/a><span style=\"font-size: small\"> (sequence containers)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-2-of-n\/\"><span style=\"color: #0000ff;font-size: small\">Part 2<\/span><\/a><span style=\"font-size: small\"> (associative containers)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-3-of-n\/\"><span style=\"color: #0000ff;font-size: small\">Part 3<\/span><\/a><span style=\"font-size: small\"> (smart pointers)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-4-of-n\/\"><span style=\"color: #0000ff;font-size: small\">Part 4<\/span><\/a><span style=\"font-size: small\"> (Nurikabe solver) &#8211; see Wikipedia&#8217;s <\/span><a href=\"http:\/\/en.wikipedia.org\/wiki\/Nurikabe\"><span style=\"color: #0000ff;font-size: small\">article<\/span><\/a><span style=\"font-size: small\"> and my <\/span><a href=\"http:\/\/cid-e66e02dc83efb165.office.live.com\/browse.aspx\/nurikabe\"><span style=\"color: #0000ff;font-size: small\">updated source code<\/span><\/a><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-5-of-n\/\"><span style=\"color: #0000ff;font-size: small\">Part 5<\/span><\/a><span style=\"font-size: small\"> (Nurikabe solver, continued)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-6-of-n\"><span style=\"color: #0000ff;font-size: small\">Part 6<\/span><\/a><span style=\"font-size: small\"> (algorithms and functors)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-7-of-n\"><span style=\"color: #0000ff;font-size: small\">Part 7<\/span><\/a><span style=\"font-size: small\"> (algorithms and functors, continued)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-8-of-n\"><span style=\"color: #0000ff;font-size: small\">Part 8<\/span><\/a><span style=\"font-size: small\"> (regular expressions)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-9-of-n\"><span style=\"color: #0000ff;font-size: small\">Part 9<\/span><\/a><span style=\"font-size: small\"> (rvalue references)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-10-of-10\"><span style=\"color: #0000ff;font-size: small\">Part 10<\/span><\/a><span style=\"font-size: small\"> (type traits)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-size: small\"><span style=\"font-family: 'Verdana','sans-serif'\">&nbsp;<\/span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-size: small\"><span style=\"font-family: 'Verdana','sans-serif'\">[Advanced STL]<\/span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-1-of-n\"><span style=\"color: #0000ff;font-size: small\">Part 1<\/span><\/a><span style=\"font-size: small\"> (shared_ptr &#8211; type erasure)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-2-of-n\"><span style=\"color: #0000ff;font-size: small\">Part 2<\/span><\/a><span style=\"font-size: small\"> (equal()\/copy() &#8211; algorithm optimizations)<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-3-of-n\"><span style=\"color: #0000ff;font-size: small\">Part 3<\/span><\/a><span style=\"font-size: small\"> (_ITERATOR_DEBUG_LEVEL, #pragma detect_mismatch, and \/d1reportSingleClassLayout)<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\">\n<p><span style=\"font-family: Times New Roman;font-size: small\">&nbsp;<\/span><\/p>\n<\/p>\n<p class=\"MsoNormal\"><span style=\"font-size: small\"><span style=\"font-family: 'Verdana','sans-serif'\">Stephan T. Lavavej<\/span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Verdana','sans-serif'\"><span style=\"font-size: small\">Visual C++ Libraries Developer<\/span><\/span><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Part 3 of my video lecture series exploring the Standard Template Library&#8217;s implementation, I explain how our powerful correctness checks in debug mode work.&nbsp; In VC10, they&#8217;re controlled by the macro _ITERATOR_DEBUG_LEVEL, which supersedes VC8 and VC9&#8217;s more confusing _SECURE_SCL and _HAS_ITERATOR_DEBUGGING macros.&nbsp; Additionally, VC10&#8217;s #pragma detect_mismatch allows the linker to detect badness that [&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,3,32],"class_list":["post-3193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-channel-9","tag-dev","tag-stl"],"acf":[],"blog_post_summary":"<p>In Part 3 of my video lecture series exploring the Standard Template Library&#8217;s implementation, I explain how our powerful correctness checks in debug mode work.&nbsp; In VC10, they&#8217;re controlled by the macro _ITERATOR_DEBUG_LEVEL, which supersedes VC8 and VC9&#8217;s more confusing _SECURE_SCL and _HAS_ITERATOR_DEBUGGING macros.&nbsp; Additionally, VC10&#8217;s #pragma detect_mismatch allows the linker to detect badness that [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/3193","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=3193"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/3193\/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=3193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=3193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=3193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}