This project is read-only.


Rating: No reviews yet
Downloads: 1613
Change Set: 073a3877eb7c
Released: Sep 19, 2014
Updated: Oct 1, 2014 by marten_range
Dev status: Stable Help Icon

Recommended Download

Source Code cpplinq.hpp
source code, 197K, uploaded Sep 19, 2014 - 1613 downloads

Release Notes

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:
  • 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
  • VS14 Preview
  • 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 ()
    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
            from_array (ints)
        >>  where ([](int i) {return i%2 ==0;})     // Keep only even numbers
        >>  sum ()                                  // Sum remaining numbers

See documentation for more details.

Reviews for this release

No reviews yet for this release. (Previous release: 5 stars out of five with 2 ratings and 1 review)