LINQ for C++ (cpplinq) is an extensible C++11 library of higher-order functions for range manipulation. cpplinq draws inspiration from LINQ for C#.
This release includes just the source code.
What's new in this release:
Thanks to:
Tested on:
This is a sample on how to use cpplinq:
See documentation for more details.
This release includes just the source code.
What's new in this release:
- Fixed an issue with wrong return type for first (). Thanks to Sepidar for finding this bug.
- Fixed max () for float-like types. Thanks to tjohnson937 for finding this bug.
- Fixed select () so that it only evaluates the predicate once per value. Thanks to tjohnson937 for providing the solution to this issue.
- Minor tweaks (whitespaces, code coverage and so on)
Thanks to:
- tjohnson937
- Sepidar
Tested on:
- VS2013 Update 3
- g++ 4.8.2 (with -std=c++11)
- clang3.4 (with -std=c++11)
This is a sample on how to use cpplinq:
#include "cpplinq.hpp"int computes_a_sum () { usingnamespace cpplinq; int ints[] = {3,1,4,1,5,9,2,6,5,4}; // Computes the sum of all even numbers in the sequence abovereturn from_array (ints) >> where ([](int i) {return i%2 ==0;}) // Keep only even numbers>> sum () // Sum remaining numbers ; }
See documentation for more details.