An open API service indexing awesome lists of open source software.

https://github.com/neshkeev/cppipe

A bash's pipe-like operator for c++
https://github.com/neshkeev/cppipe

cpp20 header-only monadic pipeline variant

Last synced: 6 months ago
JSON representation

A bash's pipe-like operator for c++

Awesome Lists containing this project

README

          

# Overview

Introduce the bash-like pipe functionality to C++. This is a header only library.

# Building

```
$ cd cppipe # local repository
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
$ ctest -C Debug # run tests if needed
$ sudo cmake --install .
```

# Example

```cpp
#include

using namespace cppipe;

int main(int argc, char** argv)
{
Result start = 1;
auto inc = [](auto&& i) -> Result { return i + 1; };
Result result = start
>> [](auto&& i) -> Result { return i * 2; }
>> inc
>> inc;

int res = run(result,
[](auto&& i) { return i; },
[](auto&& err) { return -1; });

...
}
```
Please take a look at [tests](test/) for more