Giter Site home page Giter Site logo

cpplinq's Introduction

CppLinq

A simple LINQ library for C++.

Usage

To find the square root of the non-negative even numbers less than 10:

using namespace std;
using namespace linq;

range(0, 10) >>
	where([](int a) { return a % 2 == 0; }) >>
	select([](int a) { return sqrt(a); }) >>
	for_each([](double a) { cout << a << endl; });

Here we use operator>> to make it extensible. For extension sample, see extension_test.cpp.

Supported methods

Core

  • append
  • concat
  • insert
  • prepend
  • range
  • repeat

Query

  • select
  • select_index
  • select_many
  • select_many_index
  • skip
  • skip_while
  • skip_while_index
  • take
  • take_while
  • take_while_index
  • where
  • where_index
  • zip
  • zip_index

Aggregate

  • aggregate
  • all
  • any
  • average
  • back
  • contains
  • count
  • default_if_empty
  • distinct
  • empty
  • except
  • for_each
  • for_each_index
  • front
  • get_at
  • group
  • group_join
  • index_of
  • intersect
  • join
  • limit
  • max
  • min
  • peek
  • peek_index
  • reverse
  • single
  • sort
  • sum
  • union_set

ToContainer

  • to_deque
  • to_list
  • to_map
  • to_multimap
  • to_multiset
  • to_set
  • to_unordered_map
  • to_unordered_multimap
  • to_unordered_multiset
  • to_unordered_set
  • to_vector

String

  • ends_with
  • instr
  • joinstr
  • read_lines
  • remove
  • replace
  • split
  • starts_with
  • trim
  • trim_right
  • trim_left
  • write_lines

cpplinq's People

Contributors

berrysoft avatar dassou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.