|
If you've compiled C++, you've probably seen something like this: |
|
| If you stretched that out end-to-end, it would encircle the earth... Now, "true" C++ programmers will tell you that they filter all the junk out automatically and just see the basics of what's being said, i.e. something about a find routine. But if you're like me you don't do it that quickly. In fact, you probably waste valuable time wading through all those template parameters. There is nothing fancy about the script, and "true" Perl programmers will probably chuckle and do the same thing in a one-liner. But when I couldn't figure it out by myself, I thought a bunch of other people might not be able to figure it out either. So I posted it below: |
|
| The result of the script is quite simple to understand: |
|
| It's something about finding a string in a map of strings. Of course there's no such thing as a map of strings (maps are made up of pairs) but combined with the line numbers most compilers emit during error messages, it should clue you in that something about a map which you are using is messed up. Note that this message was emitted by the GCC compiler, which implements maps using red-black trees (_Rb_tree). Your compiler may say something different, but at least now you'll be able to strip out all the template parameters. |
Thanks to the people who told me how to do this:
|
|
Update suggested by John Saalwaechter: The script above has two deficiencies:
|
|