Braden++

Visualizing boost::unordered_map in GDB, with pretty-printer customization points

This article is about my experience implementing GDB pretty-printers for the Boost.Unordered containers. You can read my related pair of articles on the Visual Studio natvis implementation here and here.

Importantly, in this article I’ll outline the techniques I used so that users can inject their own behaviour into the pretty-printers when the containers are using custom fancy pointer types. A “pretty-printer customization point” is my nickname for the technique I’m using, not an official term.

read more

Natvis for boost::concurrent_flat_map, and why fancy pointers are hard

This is the 2nd article about my experience implementing custom visualizations for the Boost.Unordered containers in the Visual Studio Natvis framework. You can read the 1st article here.

This 2nd article is about the open-addressing containers, which all have shared internals. These are the boost::unordered_flat_{map|set}, boost::unordered_node_{map|set}, and boost::concurrent_flat_{map|set}. I’ll take you through my natvis implementation in this article, omitting the methods and details that the 1st article already covered.

read more

Natvis for boost::unordered_map, and how to use <Intrinsic> elements

Recently I’ve been working on implementing custom visualizations for the Boost.Unordered containers in the Visual Studio Natvis framework, to provide an identical debugging experience in the Boost.Unordered containers to what we get for the STL containers. Here is the file.

This has been a tricky process, and I found the natvis documentation online to be lacking a few key pieces of information I needed. With this (and subsequent) article, I will take you through the experience of implementing the natvis file for Boost.Unordered.

read more

The Parser concept (+ NoneOf and AllOf)

Continuing on my series on my expression template parser generator library…

So far I’ve defined the AnyOf parser, that checks whether the first character of the input string matches any characters from a given set. This is one of my “primitive” parsers. I’ve thought of 2 other “primitives” to act as a basis for the library: NoneOf and AllOf. After that, let’s expand on the idea of a “Parser” in general.

read more

My first compiler bug

I talked about this in a lightning talk at C++Now 2023. I want to go into more detail here.

It’s exciting in a masochistic way I guess. A sort of self-schadenfreude. Somehow I found a bug in a major compiler! Frustrating for my workflow obviously, but it feels like a compliment, in a strange way.

Long story short: I hit a bug in MSVC where (spoiler) a non-type template parameter gets zeroed out at run-time but not at compile-time. Long story long: let’s talk about how I got there.

read more

One char at a time

Last time I had a brief explanation of the library I want to design. I want to create parser combinators using expression templates, where all information is in the parser types themselves, with no data members.

Writing this library has been a hugely enjoyable experience. I’m sure I’ll find flaws and issues to be addressed, after writing these articles. So let’s start simple and work up to the more complex cases. How simple can we get? How about a type that parses exactly 1 character.

read more

A string literal as a template argument

But first, a preamble

This is my backstory before the recipe in this metaphorical cookbook.

I was first introduced to the idea of parser combinators in a CppCon talk not about parser combinators, at least not as the main feature. Ben Deane and Jason Turner’s famous “constexpr ALL the Things!” talk opened my eyes to the magic that’s possible with parser combinators, and I wanted to do it too! I tried and failed to replicate what they had, then gave it up.

read more