Compiler Bugs Fixed In Visual Studio 2012

Following STL Bugs Fixed In Visual Studio 2012, here are similar lists for the compiler front-end (responsible for parsing C++)… ID Title 599151 Using declaration for a name of a type does not work in MS C++ compilers 603872 Support for XML Documentation in native C++ code 611359 C++ compiler: Temporary object created when it… Read more

Container Pretty Printer – Advanced STL, Part 6

In Part 6 of my second video lecture series focused on the Standard Template Library, I demonstrate how to write a “pretty printer” for STL containers that’s capable of formatting a vector<tuple<int, string, int>> as [(1, “ten”, 100), (2, “twenty”, 200), (3, “thirty”, 300)].  It’s easy to use, with the default syntax being print(cout, container),… Read more

The Visual C++ Weekly Vol. 1 Issue 22 (May 28, 2011)

Read in this issue: Enforcing Correct Concurrent Access of Class Data DirectCompute Lecture Series 230: GPU Accelerated Physics InformIT: Top Ten Tips for Correct C++ Coding ACCU 2011: Michael Feathers On Our Ability To Do Much Mixed-mode scenario with tracking handles to value types CSyncCollection v1.09 Referential danger Why is my program terminating with exit… Read more

_ITERATOR_DEBUG_LEVEL – Advanced STL, Part 3

In Part 3 of my video lecture series exploring the Standard Template Library’s implementation, I explain how our powerful correctness checks in debug mode work.  In VC10, they’re controlled by the macro _ITERATOR_DEBUG_LEVEL, which supersedes VC8 and VC9’s more confusing _SECURE_SCL and _HAS_ITERATOR_DEBUGGING macros.  Additionally, VC10’s #pragma detect_mismatch allows the linker to detect badness that… Read more

Algorithm Optimizations – Advanced STL, Part 2

Part 2 of my video lecture series exploring the Standard Template Library’s implementation is now available.  In this part, I walk through how our STL algorithms equal() and copy() use template metaprogramming to detect when it’s safe to call memcmp() and memmove(), which are potentially faster than the generic loops.   In Part 1’s comments,… Read more

shared_ptr – Advanced STL, Part 1

Part 1 of my video lecture series exploring the Standard Template Library’s implementation is now available.  In this part, I explain how some of shared_ptr’s magic works, including type erasure and make_shared<T>()’s optimizations that save both space and time.   This advanced series assumes that you’re familiar with C++ and the STL’s interface, but not… Read more

Rvalue References and Type Traits – Video Introduction to the STL, Parts 9 and 10

The final parts of my video lecture series introducing the Standard Template Library are now available.  Part 9 covers a single function, std::move(), and explains how rvalue references power move semantics.  Part 10 covers <type_traits>, a header added by TR1/C++0x, and explains the basics of template metaprogramming.   Here’s the full series:   Part 1… Read more

Regular Expressions – Video Introduction to the STL, Part 8

C++0x’s <regex> header combines Perl’s regular expressions with C++’s templates and iterators.  The result, like the rest of the STL, is insanely powerful but potentially overwhelming at first sight.  It’s actually easy to use, and much easier than writing string processing code by hand.  I demonstrate how to start using <regex> in Part 8 of… Read more

Video Introduction to the STL, Parts 6 and 7

Part 6 and Part 7 of my video lecture series introducing the Standard Template Library are now available; they cover algorithms and functors.   Previous parts:   Part 1 (sequence containers) Part 2 (associative containers) Part 3 (smart pointers) Part 4 (Nurikabe solver introduction) Part 5 (Nurikabe solver conclusion)   My Nurikabe solver, available here,… Read more

Video Introduction to the STL, Part 5

In the fifth part of my video lecture series introducing the Standard Template Library, I explain how the advanced analysis in my Nurikabe solver works.  One of its steps involves using a breadth-first search to detect any unreachable cells.   Mandatory prerequisites of Part 5 are reading Wikipedia’s Nurikabe page and watching Part 4 (the… Read more