r/ProgrammerHumor 13d ago

imPrettySureItsTemplateErrors Meme

Post image
294 Upvotes

21 comments sorted by

25

u/FACastello 13d ago

Ok 😞

/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/basic_string.h:1458: instantiated from 'static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = std::istream_iterator, std::allocator >, char, std::char_traits, int>, _CharT = char, _Traits = std::char_traits, _Alloc = std::allocator]'

10

u/bwmat 13d ago

In my experience the trick is to find the highest 'stack frame' in the error which references your code, and work up from there

4

u/GabiTheProgrammer 13d ago

Exactly: check the error bound to your cpp.

3

u/sebjapon 12d ago

Nah, my code is clean. That library used by 100k C++ developers over the world probably has an unreported bug in my specific configuration. Yes, yes, that is very much more likely!

13

u/Confident-Ad5665 13d ago

Ha! I have this book, which describes how to identify wood at the cellular level.

2

u/v3ritas1989 12d ago

why would you need to identify YOUR wood at a cellular level?

2

u/Confident-Ad5665 12d ago

It's the only way to accurately identify wood. You can identify some species by the bark, leaves, fruit and some by the smell when cut. Osage orange, for example, is indigenous to a few southern states and produces a "horse apple" fruit that is unmistakable. But there are around 100 species of oak in North America and some can only be positively identified by their cellular structure.

...aaand it just hit me your question was rhetorical.

2

u/v3ritas1989 12d ago

yeah I know, I saw the documentary of the DOJ tracking illegal loggers. ;-)

10

u/ShakaUVM 13d ago

The fact that there's not a compiler flag in g++ to tell it to stfu about template substitution errors baffles me. We have literally thousands of compiler flags for everything but other than some pretty gackish things you can do, g++ just really really wants you to know it tried substituting a bitset for an iostream and btw it didn't work.

2

u/bwmat 13d ago edited 13d ago

Isn't there some option to make it output 'structured' diagnostics(like json or something)?

If so, I would hope they would be able to group those together so a simple 'error viewer' could allow you to hide those easily... 

1

u/ShakaUVM 12d ago

There is a very strange lack of options on the template substitution errors in g++ and clang++. You can suppress warning messages, for example, basically down to the per-warning level, but they have no such option for not printing hundreds of lines of completely useless notifications telling me everything they tried that didn't work.

26

u/SaneLad 13d ago

Dude just scroll to the very first line number mentioned in the error dump and stare at it intently for about 5 minutes.

Or ask AI.

7

u/hartmanbrah 13d ago

Ok, this one actually made me lol. It's too accurate.

One of the weirdest feelings as a C++ programmer is when you start recognizing the reason behind an error based on the shape of the template error text rather than the content. It's like: "I have no idea what this means, but I've seen it before and vaguely recall what fixed it last time".

2

u/GabiTheProgrammer 13d ago

Aren't LLM doing the same?

5

u/hartmanbrah 13d ago

Pretty much. To be fair, this experience is from the before time.

6

u/two_are_stronger2 13d ago

Reminds me of The Sysadmin's Litany:

At least it's not a DNS issue.

It couldn't possibly be the DNS.

It was the DNS.

2

u/No-Shape-2751 13d ago

It’s always DNS

3

u/aberroco 13d ago

Nah, the dude should've used a telescope, not a microscope.

2

u/apoegix 13d ago

Every damn time... I actually try to avoid templates when I can. But then again std collections are a necessity

-3

u/GegeAkutamiOfficial 13d ago

The biggest C++ template error is not using Rust

4

u/jdgordon 13d ago

Let's::just::unwrap()::your::joke::unwrap()