LINQ for C++ is an attempt to bring LINQ-like list manipulation to C++11.
This release includes just the source code.
What's new in this release:
- join range operators: Inner Joins two ranges using a key selector
- reverse range operator
- distinct range operator
- union_with range operator
- intersect_with range operator
- except range operator
- concat range operator
- sequence_equal range aggregator
- to_lookup range aggregator
This is a sample on how to use cpplinq:
#include "cpplinq.hpp"
int computes_a_sum ()
{
using namespace cpplinq;
int ints[] = {3,1,4,1,5,9,2,6,5,4};
// Computes the sum of all even numbers in the sequence above
return
from_array (ints)
>> where ([](int i) {return i%2 ==0;}) // Keep only even numbers
>> sum () // Sum remaining numbers
;
}
See
documentation for more details.