https://github.com/sunxfancy/libstream
Streamful function call
https://github.com/sunxfancy/libstream
Last synced: 3 months 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 (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-11T02:53:18.000Z (over 9 years ago)
- Last Synced: 2025-02-15T06:42:25.556Z (5 months ago)
- Language: C++
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- 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();
```