- Feature Articles
-
CodeSOD
- Most Recent Articles
- A Pair of Loops
- What a More And
- Hall of Mirrors
- Magical Bytes
- Contact Us
- Plugin Acrobatics
- Recursive Search
- Objectified
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Looks like they're allergic to references... That first loop would be a lot more efficient written as for(string const & name : invec) Thinking on it, maybe they don't know about references at all and that's the reason for the pointer in the map? That actually allows changing the value of the string pointed to, even if you're looping using copies of the vector content...
Admin
Well Remi, you ARE right,
But where's your sense of adventure ! Think about all the modern day explorers, crawling through this code base like cartographers trying to map the sources of Nile, choping their ways throught the jungle, the moskitos swarms of pointers to things yet to be discovered, the...
And what a high level of creativity this is.
Edit Admin
Remy, shouldn't you know better by now?
Edit Admin
What about the WTF of them missing out the const reference for the invec parameter?
Edit Admin
I had a little more context from the submitter, in this case that let me say that. ;)
Edit Admin
Is
missing a pointer dereference?
Admin
30%, by just iterating twice. I am sure.