TartanLlama / expected

C++11/14/17 std::expected with functional-style extensions

Home Page:https://tl.tartanllama.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kind of hideous to view in a debugger, isn't it?

jerkstorecaller opened this issue · comments

I'm sure this was implemented in the most performant manner possible and a lot of devs will appreciate that, but as a result this is the depth I had to go to in gdb to see the return value:

expected

Would anyone else prefer a less efficient/flatter implementation that makes debugging more pleasant? I mean this feature is for unexpected things, this isn't gonna be your performance bottleneck.

Thanks for the issue. Performance is very important for a library like this because, although it's used when unexpected things might happen, performance for the path where everything goes fine is affected by it as well, and if you don't implement it using these kinds of base classes, codegen gets waaaaay worse.

A better solution than flattening the implementation would be to provide custom debugger visualisations (e.g. natvis files for Visual Studio).

Ah, you're right, that would be the better approach. I think small because I'm using C++ for writing basic desktop apps. gdb seems to have high-level support for pretty printers, I'll see if I can contribute something when I have time.
:)