News for hackers. Stuff that matters.
Re:An Idiot's Guide to C++ Templates - Part 1 by btilly on Tuesday April 23, 2013 @09:05AM (#5594817)
As I said, my C++ experience is limited.

Thank you for demonstrating a better way to do it. Hopefully I'll remember that the next time that I need it. (Which is likely to be several years from now.)

Also you're right that I would like streams and generators. But, to me, it is the same abstraction as iteration. See, for instance, how Python does it.

Re:An Idiot's Guide to C++ Templates - Part 1 by marblar on Tuesday April 23, 2013 @09:18AM (#5594894)
You should check out the boost iterator library. Depending on the application, you might be looking for either the function input iterator or the counting iterator.
Re:An Idiot's Guide to C++ Templates - Part 1 by btilly on Tuesday April 23, 2013 @09:33AM (#5594994)
I have avoided learning boost for the simple reason that on the rare occasions when I need C++, it has been apparent to me that I could easily spend longer trying to evaluate whether anything that is available would be a good fit for my problem, than it would take to be done.

Put another way, the effort of learning something needs to be amortized over all of the times that you'll likely use that knowledge. I use C++, rarely enough that I won't get much amortization. (And when I do use it, it is painful enough that I don't want to explore it just for personal enjoyment. Leading to my avoiding C++...)