[PATCH] D48512: [gdb] Add pretty printer for Expected

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 25 16:45:46 PDT 2018


MaskRay added a comment.

In https://reviews.llvm.org/D48512#1142960, @dblaikie wrote:

> Still not quite sure why the change in implementation of Optional - what the difference is between how it was done & how it's done now/with this patch, etc. But I'm not too fussed - if it works for you :)


I find the same trick is used in `/usr/share/gcc-8/python/libstdcxx/v6/printers.py`. The base class defines some boilerplate (`__iter__`, Python 2 compatible `def next`) so that the nested `_iterator` class can be flattened into the outer class.


Repository:
  rL LLVM

https://reviews.llvm.org/D48512





More information about the llvm-commits mailing list