https://github.com/mrange/cpplinq
LINQ for C++ (cpplinq) is an extensible C++11 library of higher-order functions for range manipulation. cpplinq draws inspiration from LINQ for C#.
https://github.com/mrange/cpplinq
Last synced: about 1 year ago
JSON representation
LINQ for C++ (cpplinq) is an extensible C++11 library of higher-order functions for range manipulation. cpplinq draws inspiration from LINQ for C#.
- Host: GitHub
- URL: https://github.com/mrange/cpplinq
- Owner: mrange
- License: other
- Created: 2012-10-06T16:41:19.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2021-02-17T03:45:12.000Z (over 5 years ago)
- Last Synced: 2025-04-02T02:09:04.933Z (about 1 year ago)
- Language: C++
- Homepage: http://cpplinq.codeplex.com/
- Size: 757 KB
- Stars: 185
- Watchers: 27
- Forks: 40
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: License.html
Awesome Lists containing this project
README
cpplinq - LINQ-like list manipulations for C++11
================================================
LINQ for C++ (cpplinq) is an extensible C++11 library of higher-order functions for range manipulation. cpplinq draws inspiration from LINQ for C#.
```cpp
#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 the documentation: http://cpplinq.codeplex.com/documentation