Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunxfancy/libstream
Streamful function call
https://github.com/sunxfancy/libstream
Last synced: about 20 hours ago
JSON representation
Streamful function call
- Host: GitHub
- URL: https://github.com/sunxfancy/libstream
- Owner: sunxfancy
- License: mit
- Created: 2016-01-11T02:49:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-11T02:53:18.000Z (almost 9 years ago)
- Last Synced: 2023-08-08T03:12:50.346Z (over 1 year ago)
- Language: C++
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- License: LICENSE
Awesome Lists containing this project
README
libstream
===============Streamful function for C++
## What a stream
We used the `>>` stream opeator for some continuous function call. It will reduce the callback function used.
eg. When we do some work one by one, and the next function's input will be the last function's return.
```
auto ret = some.func(args);
auto ret2 = some.func2(ret);
auto ret3 = some.func3(ret2);
...
```Sometimes, it will be this:
```
auto ret = some.func3(some.func2(some.func(args)));
```We want to change it to this:
```
func(args) >> some.func >> some.func2 >> some.func3;
func.call();
or
func.callsync();
```