Skip to content
LINQ for C++ (cpplinq) is an extensible C++11 library of higher-order functions for range manipulation. cpplinq draws inspiration from LINQ for C#.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CppLinq.Mini
CppLinq
CppLinq2013.UnitTest
Media
NuGet
Test
docs
.gitignore
CppLinq2010Express.sln
CppLinq2012.sln
CppLinq2013.sln
License.html
README.md Update README.md Apr 9, 2014

README.md

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#.

#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

You can’t perform that action at this time.