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:
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:
- Non standard #pragma once replaced with header guards
- first() added
- throw() removed from range::operator>> (in order to enable operators such a first() to throw on empty sequences)
- const correctness fixes
- code style fixes
- Returns reference to locally scoped instance fixed
Thanks to:
- breyed - for the implementation of first() and discussions regarding the return value semantics of cpplinq.
- stl - for sorting out a bug in cpplinq regarding exceptions.
- mwpowellhtx - for pointing out that #pragma once is non standard
Tested on:
- VS2012
- VS2013 (preview)
- g++ 4.7.2 (with -std=c++0x)
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.