Giter Site home page Giter Site logo

raman's Introduction

Raman: C++ Range Manipulation Library

Dependency free, header-only, low overhead.

With Raman you can manipulate ranges easily: transform, filter, sort, etc.

Using Raman will make your code expressive, readable and short. Examples:

raman::From(input).Where(<lambda>);
raman::From(input).Sort();
raman::From(input).Reverse();

Of course, you can combine multiple methods very easily, like:

raman::From(input).Where(<lambda>).Sort().Reverse();

Usage

Every usage of Raman begins by wrapping your range (be it a container or a pair of iterators) with raman::From(). You may use any STL or STL-like container / iterator.

Once wrapped, you may use any of the utility functions in raman.hpp to manipulate your ranges, like Where(), AddressOf(), Sort(), Reverse(), etc.

Raman is designed to be used with range-based for loop, like:

for (const auto& i : raman::From(input).Where(<lambda>)) {
  // ...
}

Raman also has a convenient implicit-cast operator, so you can copy the manipulated range to any container, like:

list<int> l = ...;
vector<int> list_to_vector = raman::From(l).Where(<lambda>);

Raman also supports move-semantics, so the following is safe:

for (string s : raman::From(GetStrings()).Sort().Unique().Reverse()) {
  // ...
}

In this case Raman will take ownership of the container returned by GetStrings().

Getting Started

Start by reading the comment in the beginning of raman.hpp, then the test cases in tests.cpp.

Now that you know roughly how to use Raman, simply #include "raman.hpp" and you're ready to go. No dependencies, no linking.

How Can I Help?

Feel free to file bugs, ask questions or send pull requests!

raman's People

Contributors

chakaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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