OK, I've finally precisely pinpointed the problem and solved it.
The root cause of the problem is not a C++ issue at all. cin, istringstream, get_money() and money_get<> all work just fine.
It's basically an input issue.
Consider the following input string:
$1.11 $2.22 $3.33 $4.44 $5.55
When entered offline
, it is read perfectly correctly, as entered.
However, when entered online
, the "$1", "$2", "$3", etc. are not read into the input. They are treated as special characters. This is why on coliru (and possibly any other online C++ engine), the $ amounts were not getting read correctly. This may be a UNIX issue, where $ is treated as a special character.
The solution is to escape it: instead of $, enter \$.
\$1.11 \$2.22 \$3.33 \$4.44 \$5.55
There's some junk on that link, but you can get the gist of it.
-- EDIT --
The link only pinpoints the root cause. I shall use it to develop the complete solution and post it later.