As most programmers I admire and try to follow the principles of Literate programming, but in C++ I routinely find myself using std::pair
, for a gazillion common tasks. But std::pair
is, IMHO, a vile enemy of literate programming...
My point is when I come back to code I've written a day or two ago, and I see manipulations of a std::pair
(typically as an iterator) I wonder to myself "what did iter->first and iter->second mean???".
I'm guessing others have the same doubts when looking at their std::pair
code, so I was wondering, has anyone come up with some good solutions to recover literacy when using std::pair
?