Re:The overhead of abstraction in C/C++ vs. Python/Ruby
by ajtulloch on Saturday October 18, 2014 @09:42PM
(#8476969)
FWIW, with folly::gen [1], this is just:
https://github.com/facebook/folly/tree/master/folly/gen
[ Parent
| on HN ]
Re:The overhead of abstraction in C/C++ vs. Python/Ruby
by nly on Sunday October 19, 2014 @05:30AM
(#8477747)
It's only 2 lines even restricting yourself to the standard library
#include <fstream>
#include <iterator>
#include <numeric>
using namespace std;
int main() {
ifstream nf ("numbers.txt");
return accumulate (istream_iterator<int>(nf), istream_iterator<int>(), 0);
}